Urd is a scheduler for Django projects
Project description
Urd is a scheduler for Django projects. Some features:
schedule < 1m time slots
single concurrent execution [1]
fast enable/disable [2]
simple deployment
no extra dependencies beyond Django
Setup
Install urd pip install urd
Add urd to INSTALLED_APPS
Run manage.py migrate
Start the scheduler with manage.py monitor
Usage
Define a tasks.py module in the app that should have tasks.
Create a function like this:
@schedulable_task
def my_task(heartbeat):
for foo in bar:
heartbeat()
do_some_task()
Calling heartbeat() regularly is important to make the task cancellable in a timely manner.
Now define a task in the iommi admin. It will be enabled pretty much as soon as you save.
Administration
Urd ships with integration for the iommi admin.
Why not cron/celery/django-q
Cron didn’t work for me because I need to execute a function more often than once a minute
Cron also doesn’t work for me because if you do once per minute, and the task takes two minutes, you get TWO executing processes of that task for a while. This can be disastrous for a few reasons, and can cause things to spiral out of control.
Celery/django-q are task queues, not schedulers. They have scheduler components, but they don’t have a way to ensure only one process at a time runs a specific task.
Django-q doesn’t allow schedules that execute more often than once per minute
Django-q caused me a lot of problems where the schedule seemed to put future items in the queue, and I couldn’t make it stop trying to execute them.
What does urd mean?
Urd (or Urðr, or Wyrd) is one of the Norns, the goddesses who weave the destiny of gods and humans.
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 urd-1.2.1.tar.gz
.
File metadata
- Download URL: urd-1.2.1.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ce959b8588f524698c316e895868a0f5187a38d0653c228c44328f1594d61d |
|
MD5 | da0c63d2ac8ef00106ca336808a7ff28 |
|
BLAKE2b-256 | 84a360862cb16766909e2d395f03a9584b9f010b17274f86027eb8f24468b2ce |
File details
Details for the file urd-1.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: urd-1.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7000638734d06b7f8475ae53670b0b095f09146276cdfc27b897cd0575cd1096 |
|
MD5 | 2e14a70ac96ac0982061524c2e8c3c2c |
|
BLAKE2b-256 | acca29753e0687c9d18df523890b51d47d549e205a02e712c32e0970ab255c75 |