Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urd-1.3.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urd-1.3.1-py2.py3-none-any.whl (17.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file urd-1.3.1.tar.gz.

File metadata

  • Download URL: urd-1.3.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for urd-1.3.1.tar.gz
Algorithm Hash digest
SHA256 4aa18b805ec1a80025693f33327ff0c6a1c3d8eb43fa1aa0969bbdfd7ecfcdea
MD5 b9c4a9c84f926d34b7974b1f16e909ee
BLAKE2b-256 186b294d136b4eaebdb3758622c24e4383984e05def110cb7e1d309ab58d9543

See more details on using hashes here.

File details

Details for the file urd-1.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: urd-1.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for urd-1.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4505d2ebe6446e723a82cb7430dcb403f5a15118e99dcb41e5dc27aa124e19c3
MD5 28e35b7dfbcb03495ca50d3da2b10efe
BLAKE2b-256 99ac366e3a18c016b922fd8201c0be4b0ac1aa080546bf92dfcd2aa3c90e47b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page