====
[]()
[]()
[]()
A controllable timing task widgets with Celery
## About
As is known to all, Celery have a already provides periodic task and it's very perfit. But, Assume this case: After my task was called, I hope it's task can frequency of execution, and when celery task was started.
The above case, Periodic task is hard to practice, Becacuse it's depend on celery beat. ``celery-task-tigger`` do it over simple packaging or implement for solution to do it.
## Installation
~~~python
pip install celery-task-tigger
~~~
## Useage
Assume you have aleady install celery and can do it.
### Bases
Option `max_times` is must be appoint.
~~~python
from celery_tasktigger.decorator import tigger_task
@app.task(bind=True)
@tigger_task(max_times='forever') # forever is expressed unlimited time
def add(self, x, y):
return x + y
~~~
### max_times
Option `max_times`: The maximum number of execute the task times.
Type: ***int***
> Note: The value ***'forever'*** is expressed unlimited time.
Example:
~~~python
@app.task(bind=True)
@tigger_task(max_times=3) # after execute 3 times, raise an exception
def add(self, x, y):
return x + y
~~~
### countdown
Option `countdown`: You can also provide the countdown argument to execute.
Type: ***int***
Default: 1 (seconds)
Example:
~~~python
@app.task(bind=True)
@tigger_task(max_times='forever', countdown=3) # each execute in 3 seconds
def add(self, x, y):
return x + y
~~~
## How To Calling Task
~~~~python
>> from example import add
>> add.apply_async((1,2))
~~~~
you can also delayed execute task, as follow:
~~~~python
>> from example import add
>> add.apply_async((1,2), countdown=4) # after 4 seconds, begin start task
~~~~
> About Celery Task, Please see below for details:
> [Celery Calling-Tasks Document](http://docs.jinkan.org/docs/celery/userguide/calling.html)
## How To Stop
if you appoint `max_times='forever'` or provides the bigger values of max_times, you must stop it in programe.
~~~~python
>> result = add.apply_async((1,2))
>> result.revoke()
or
>> from mycelery import app
>> app.control.revoke('task_id')
~~~~
> See below for details:
> [Celery Document——FAQ](http://docs.jinkan.org/docs/celery/faq.html#can-i-cancel-the-execution-of-a-task)
## Some screenshots

## Features
- 100% full compatible with Celery
- the frequency of execution for task
- ...and many other stuff (o,0)
## Author
- Boyle Gu
Metadata
Release files for celery-task-tigger 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| celery-task-tigger-0.4.tar.gz | 4.2 kB | Without provenance | Details for celery-task-tigger-0.4.tar.gz |
Release files / celery-task-tigger-0.4.tar.gz
| Download URL | celery-task-tigger-0.4.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a6b64b7be858ae1e37cb55ef07e133d1934ff38f0aab949077cb240543b9175
|
|
BLAKE2b-256 checksum How to use checksums |
181e30c73b306ab8962464d3b3665002679d99ba17c576f1d7f21f5b8b3ff57d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for celery-task-tigger 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.