A very simple asynchronous task/job queue
Project description
Negotium
A simple, lightweight, and easy-to-use task or job queue for Python. It tries to mimic the implementation of celery and celery beat, but without the complexity and overhead. It runs on a single machine, and it is designed to be used in a single process.
For now, it offers only a minimal set of features, which will be expanded. It also currently only supports Redis as the broker; however, it is planned to support other brokers in the future.
Installation
pip install negotium
Usage
# ---- main.py (app entry point) ----
from negotium import Negotium
app = Negotium(broker_url="redis://localhost:6379/0", app_name="my_app")
app.start()
@app.task
def add(x, y):
return x + y
# --- app.py (another module) ----
from main import app
# Run the task asynchronously
add.delay(1, 2)
# Schedule the task to run at a specific time
add.apply_async(args=(1, 2), eta=datetime.datetime.now() + datetime.timedelta(seconds=10))
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
negotium-0.0.5a1.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for negotium-0.0.5a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 639e30de2c9e30b0130c5a342a5f01cbe30f62a5c8a6dfb65c2d9ae3ae75e5c9 |
|
MD5 | eccba30747784d75c6f03ed0de8c5709 |
|
BLAKE2b-256 | b00b4ae8fdaed63730f484a4334341da7d0b476866a9b59eb93de6a0f57c0798 |