Nameko cron extension
Project description
Nameko Cron
Nameko Cron
entrypoint fires based on a cron expression. It is not cluster-aware and
will fire on all service instances. The cron schedule is based on croniter.
Usage
from nameko_cron import cron
class Service:
name ="service"
@cron('*/5 * * * *')
def ping(self):
# executes every 5 minutes
print("pong")
timezone-aware cron schedules are also available
from nameko_cron import cron
class Service:
name ="service"
@cron('0 12 * * *', tz='America/Chicago')
def ping(self):
# executes every day at noon America/Chicago time
print("pong")
by default, if a worker takes longer than the next scheduled run the worker will wait until
the task is complete before immediately launching a new worker. This behavior can be controlled
via the concurrency
keyword argument.
ConcurrencyPolicy.WAIT
is that default behavior.
ConcurrencyPolicy.ALLOW
will spawn a worker regardless of whether existing workers are still running.
ConcurrencyPolicy.SKIP
will skip a run if the previous worker lapsed the next scheduled run.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nameko_cron-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19f9f1590178c52bc29990c0751f55e8ecba674ed8549dc08b7f32fad1cc6a5f |
|
MD5 | 2dec3fc9cab5971c89039c28ab7b61c1 |
|
BLAKE2b-256 | 00ab122017cceed8430d4b7d284d58cd8c60639ce7c71124a6f8f57865e5b6fc |