A reliable distributed cron with pluggable storage backends
Project description
A reliable distributed cron with pluggable storage backends
Free software: MIT license
Installation
pip install pyncette[redis]
You can also install the in-development version with:
pip install https://github.com/tibordp/pyncette/archive/master.zip
Documentation
Usage example
Simple in-memory cron (does not persist state)
from pyncette import Pyncette, Context
app = Pyncette()
@app.task(schedule='* * * * *')
async def foo(context: Context):
print('This will run every minute')
if __name__ == '__main__':
app.main()
Persistent distributed cron using Redis (coordinates execution with parallel instances and survives restarts)
from pyncette import Pyncette, Context
from pyncette.redis import redis_repository
app = Pyncette(repository_factory=redis_repository, redis_url='redis://localhost')
@app.task(schedule='* * * * * */10')
async def foo(context: Context):
print('This will run every 10 seconds')
if __name__ == '__main__':
app.main()
Development
To run the all tests run:
tox
To run just the unit tests (excluding integration tests):
tox -e py37 # or py38
Note, to combine the coverage data from all the tox environments run:
Windows |
set PYTEST_ADDOPTS=--cov-append tox |
---|---|
Other |
PYTEST_ADDOPTS=--cov-append tox |
Changelog
0.1.1 (2020-01.08)
First release that actually works.
0.0.0 (2019-12-31)
First release on PyPI.
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
pyncette-0.2.0.tar.gz
(26.9 kB
view hashes)
Built Distribution
Close
Hashes for pyncette-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1248cf0d84f0bee0129d67c0b9927d35494ec912f5465af2aea5cbe4482ea645 |
|
MD5 | eb697bd94773a7571176e8a0b7c6dccb |
|
BLAKE2b-256 | 5ea0207d16719f369a548596b38f81ec9062ded89c573d6d28788868ba26bd6b |