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 # Or, for Redis support: 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()
# alternatively asyncio.run(app.run())
Persistent distributed cron using Redis (coordinates execution with parallel instances and survives restarts)
from pyncette import Pyncette, Context
from pyncette.repository.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
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.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.0.8.tar.gz
(21.0 kB
view hashes)
Built Distribution
Close
Hashes for pyncette-0.0.8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42cb21f76581c7057cd5293266018d4ca9d9dcec8a296fbaba42b6ed84beaf3a |
|
MD5 | cc8a4dcfca67edc9285d789319296e17 |
|
BLAKE2b-256 | 42f02d3400440949cd9ed0c64dba811994a0a8ec4ec389b466b361c1319285fb |