A lightweight repeating task runner app for Django
Project description
Sisy is a Django package which uses the Channels message-passing infrastructure to run functions in worker processes. In other words, it lets you hand off work to background processes in various ways, rather than having long-running processes stall your web requests.
Sisy has the following requirements and compatibilities:
Python 3.6 or above
Django 1.11 or above, including 2.x
Channels 1.1.8 or above (earlier versions may work but no guarantees)
Sisy is released under the MIT License.
Why yet another task runner package?
There are already several fine Python packages which function as task runners, such as celery, rq, and others, but I wanted to have a package that worked seamlessly within the Channels architecture, in order to avoid duplication of effort.
Design goals
Sisy has a few design goals that it is good to keep in mind when evaluating whether it will fit your particular use case:
It is designed to work with tasks that are similar to those one would work with using the Unix cron utility. In other words, its tasks are expected to run on a frequency scale of minutes, hours, and days rather than seconds or milliseconds.
It is designed for small to medium installations. I think it probably could handle a surprisingly large site, since it is possible to separate its workers, objects, and messages onto their own infrastructure through the use of such tools as Django database routing, channel layers, and separate redis servers. But it has not been tested in these scenarios.
It is designed with developer ease of use in mind. It does lack certain facilities such as interruptibility, but such features can be designed into the functions that handle the task messages, and of course those functions can in turn send other messages if necessary.
Quick howto
You really need to read the full docs, but here is a super-fast crash course.
from sisy.models import task_with_callable
task = task_with_callable(
'mymodule.myfunction', # dotted path to function
label='weekday-business-hours-function', # any string you want here really
schedule='0,15,30,45 9-17 * * mon-fri', # Run every 15 minutes 9am-5pm on weekdays
)
# The task doesn't become active until you save it
task.save()
There are other goodies in there, such as one-shot task runs, specified number of iterations, beginning and ending dates, etc. You can also create tasks in Django data migration files, which can be really handy for standard tasks you want to always be running. Look at the docs.
Note: There is a demo project in the github repo, under extra/demo. This project is very basic, but provides concrete examples of using Sisy in various ways, including data migrations. This project also functions as the host project for generating the docs.
You can find the full documentation for Sisy at the Github Pages site for this repo.
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
File details
Details for the file sisy-1.0b3.tar.gz
.
File metadata
- Download URL: sisy-1.0b3.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8709146c500b0f2e4cbea810a851339dbe5a3e8ff03ff66c81e911c7f98c73d9 |
|
MD5 | b21d6c52b617153780ecc139557864c6 |
|
BLAKE2b-256 | d8b64c1255460560c165766c9bca67f977d239b82e41ae451a19d8e88b4e48da |
File details
Details for the file sisy-1.0b3-py3-none-any.whl
.
File metadata
- Download URL: sisy-1.0b3-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01d242f0e98a73c75ec91a8e1a1e94333465bb527198869507076f894337384e |
|
MD5 | 71593ca02e837d7eb77e0bcae955b284 |
|
BLAKE2b-256 | 82679f32043c86b29b1ebb246e20889cd6cfd48b97868f1f3e237f5adbcddbfc |