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 the basic metapackage: pip install quesadilla==0.3.0.

tasks.py:

import logging

from quesadilla.connectors.in_memory import ThreadSafeInMemoryConnector
from quesadilla.shortcuts import QueuedTask, TaskNamespace, async_task, sync_task

logging.basicConfig(level=logging.INFO)

namespace = TaskNamespace("tasks", connector=ThreadSafeInMemoryConnector())
queue = namespace.new("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


tasks: list[QueuedTask[[int], bool]] = []


# queue is preloaded with 200 tasks
for _ in range(100):
    tasks.append(simple_task.queue(0))
    tasks.append(simple_atask.queue(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
  • sync and async connectors split (probably)
  • 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.3.0.tar.gz (16.1 kB view hashes)

Uploaded Source

Built Distribution

quesadilla-0.3.0-py3-none-any.whl (19.8 kB view hashes)

Uploaded Python 3

Supported by

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