A simple cron-like library for executing scheduled jobs.
Project description
# Donkey [WIP]
[![Build Status](https://travis-ci.org/bcho/donkey.svg)](https://travis-ci.org/bcho/donkey)
A simple cron-like library for executing scheduled jobs.
Donkey is inspired by [Cron][cron-go].
[cron-go]: https://github.com/robfig/cron
```python
from datetime import datetime
from donkey import JobQueue, Worker
q = JobQueue()
@q.job(3)
def this_job_runs_every_3_seconds():
print('Fuzz', datetime.now())
@q.job(5)
def this_job_runs_every_5_seconds():
print('Buzz', datetime.now())
Worker().run(q)
# Fuzz 2015-02-03 16:41:01.408136
# Buzz 2015-02-03 16:41:03.404123
# Fuzz 2015-02-03 16:41:04.406813
# Fuzz 2015-02-03 16:41:07.408426
# Buzz 2015-02-03 16:41:08.406851
# Fuzz 2015-02-03 16:41:10.408415
# Fuzz 2015-02-03 16:41:13.403260
# Buzz 2015-02-03 16:41:13.403319
```
## TODO
- [x] tests.
- [ ] add jobs at run time.
- [ ] job states & stats (see [rq][rq]).
- [ ] other backend (namely `thread`, `stackless`) support.
[rq]: http://python-rq.org/
## License
[MIT](LICENSE)
[![Build Status](https://travis-ci.org/bcho/donkey.svg)](https://travis-ci.org/bcho/donkey)
A simple cron-like library for executing scheduled jobs.
Donkey is inspired by [Cron][cron-go].
[cron-go]: https://github.com/robfig/cron
```python
from datetime import datetime
from donkey import JobQueue, Worker
q = JobQueue()
@q.job(3)
def this_job_runs_every_3_seconds():
print('Fuzz', datetime.now())
@q.job(5)
def this_job_runs_every_5_seconds():
print('Buzz', datetime.now())
Worker().run(q)
# Fuzz 2015-02-03 16:41:01.408136
# Buzz 2015-02-03 16:41:03.404123
# Fuzz 2015-02-03 16:41:04.406813
# Fuzz 2015-02-03 16:41:07.408426
# Buzz 2015-02-03 16:41:08.406851
# Fuzz 2015-02-03 16:41:10.408415
# Fuzz 2015-02-03 16:41:13.403260
# Buzz 2015-02-03 16:41:13.403319
```
## TODO
- [x] tests.
- [ ] add jobs at run time.
- [ ] job states & stats (see [rq][rq]).
- [ ] other backend (namely `thread`, `stackless`) support.
[rq]: http://python-rq.org/
## License
[MIT](LICENSE)
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
donkey-0.0.2.tar.gz
(3.3 kB
view details)
File details
Details for the file donkey-0.0.2.tar.gz
.
File metadata
- Download URL: donkey-0.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 583098ab4d9671e2aa1206e1fbc1434455d238ad259f4da3f8ca30d341a89fcc |
|
MD5 | fcc0c85238b96428c5abf5fac54ebc1a |
|
BLAKE2b-256 | 06cf47e28e573eee714397f120db2694d72f1caa6e81231e425c96759068c9e5 |