Skip to main content

An elegant background task queue for the more civilized age

Project description

pipeline status coverage report latest release

quesadilla

quesadilla is an elegant background task queue for the more civilized age.

Example usage

First, install quesadilla: pip install quesadilla==0.5.0.

tasks.py:

import logging
import random

from quesadilla.connectors.in_memory import ThreadSafeInMemoryConnector
from quesadilla.core import TaskNamespace, async_task, sync_task

logging.basicConfig(level=logging.INFO)

namespace = TaskNamespace("tasks", connector=ThreadSafeInMemoryConnector())
queue = namespace.queue("queue")


@sync_task(queue)
def simple_task(i: int) -> bool:
    return i == 0


@async_task(queue)
async def simple_atask(i: int) -> bool:
    return i == 0


# simulate someone adding jobs to the queue
# queue is preloaded with 200 tasks
for _ in range(100):
    simple_task.queue(random.choice((0, 1)))
    simple_atask.queue(random.choice((0, 1)))

Run with python -m quesadilla runners listener tasks::queue.

Exit with SIGINT (Ctrl + C) or SIGTERM.

Roadmap

  • support for retrying failed tasks
  • support for cronjobs and heartbeat
  • support for task priority
  • support for delayed execution
  • documentation
  • a real-world connector! (most likely PostgreSQL with psycopg and SQLAlchemy 2.0)

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

quesadilla-0.5.0.post1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

quesadilla-0.5.0.post1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file quesadilla-0.5.0.post1.tar.gz.

File metadata

  • Download URL: quesadilla-0.5.0.post1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for quesadilla-0.5.0.post1.tar.gz
Algorithm Hash digest
SHA256 93705616409babda13498692676e1460d9d3019505f7ff75c5f19dc0e12b39a4
MD5 e95391774346fe40707ba56ba4b1ed46
BLAKE2b-256 dc4a1810351beaaf9db56e49056c67a11b91775677d0c2d6249fc76f31a94c53

See more details on using hashes here.

File details

Details for the file quesadilla-0.5.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for quesadilla-0.5.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 bde0044e186d10ef5f214d7c5eda38829c58313a73c865eb167adb6a27bd2dcc
MD5 ada99934f987026d1771a0e99fca44f6
BLAKE2b-256 79cd6509cb275e52a219a3b2b5daaca4097559bcbac293b82b276201c12b50c6

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