All Projects → procrastinate-org → procrastinate

procrastinate-org / procrastinate

Licence: MIT License
PostgreSQL-based Task Queue for Python

Programming Languages

python
139335 projects - #7 most used programming language
PLpgSQL
1095 projects

Projects that are alternatives of or similar to procrastinate

email-framework
A simple, gulp powered framework to develop and test responsive emails.
Stars: ✭ 19 (-94.1%)
Mutual labels:  sync
KoHighlights
KOHighlights is a utility for viewing KOReader's highlights and/or export them to simple text, csv or html files.
Stars: ✭ 62 (-80.75%)
Mutual labels:  sync
concurrent-tasks
A simple task runner which will run all tasks till completion, while maintaining concurrency limits.
Stars: ✭ 27 (-91.61%)
Mutual labels:  task-queue
sync-db
Utility to synchronize relational database objects across databases.
Stars: ✭ 15 (-95.34%)
Mutual labels:  sync
reddit-pocket-sync
No description or website provided.
Stars: ✭ 37 (-88.51%)
Mutual labels:  sync
simple-task-queue
asynchronous task queues using python's multiprocessing library
Stars: ✭ 39 (-87.89%)
Mutual labels:  task-queue
node-v
🔒 Secure ❄️ Synchronized ⚡️ Realtime ☁️ Cloud 🌈 Native JavaScript Variables & Events
Stars: ✭ 27 (-91.61%)
Mutual labels:  sync
tarantool rs
Sync/Async tarantool database connector. WORK IN PROGRESS. DON'T SHARE THIS REPO
Stars: ✭ 14 (-95.65%)
Mutual labels:  sync
psched
Priority-based Task Scheduling for Modern C++
Stars: ✭ 59 (-81.68%)
Mutual labels:  task-queue
celery.node
Celery task queue client/worker for nodejs
Stars: ✭ 164 (-49.07%)
Mutual labels:  task-queue
docker-aws-s3-sync
Docker container to sync a folder to Amazon S3
Stars: ✭ 21 (-93.48%)
Mutual labels:  sync
hstdb
Better history management for zsh. Based on ideas from https://github.com/larkery/zsh-histdb.
Stars: ✭ 25 (-92.24%)
Mutual labels:  sync
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (-95.03%)
Mutual labels:  sync
S4
🔄 Fast and cheap synchronisation of files using Amazon S3
Stars: ✭ 69 (-78.57%)
Mutual labels:  sync
docker base images
Vlad's Base Images for Docker
Stars: ✭ 61 (-81.06%)
Mutual labels:  sync
dnd-sync
Sync DND state between Android phone and watch
Stars: ✭ 23 (-92.86%)
Mutual labels:  sync
multihack-brackets
Realtime collaboration for programmers. (Brackets Extension)
Stars: ✭ 24 (-92.55%)
Mutual labels:  sync
git-documentdb
Offline-first Database that Syncs with Git
Stars: ✭ 20 (-93.79%)
Mutual labels:  sync
tsdav
WebDAV, CALDAV, and CARDDAV client for Nodejs and the Browser
Stars: ✭ 33 (-89.75%)
Mutual labels:  sync
atom-package-sync
Synchronize your atom packages and settings easily
Stars: ✭ 22 (-93.17%)
Mutual labels:  sync

Procrastinate: PostgreSQL-based Task Queue for Python

Deployed to PyPI Deployed to PyPI GitHub Repository Continuous Integration Documentation Coverage MIT License Contributor Covenant

Procrastinate is an open-source Python 3.7+ distributed task processing library, leveraging PostgreSQL to store task definitions, manage locks and dispatch tasks. It can be used within both sync and async code.

In other words, from your main code, you call specific functions (tasks) in a special way and instead of being run on the spot, they're scheduled to be run elsewhere, now or in the future.

Here's an example:

# mycode.py
import procrastinate

# Make an app in your code
app = procrastinate.App(connector=procrastinate.AiopgConnector())

# Then define tasks
@app.task(queue="sums")
def sum(a, b):
    with open("myfile", "w") as f:
        f.write(str(a + b))

with app.open():
    # Launch a job
    sum.defer(a=3, b=5)

    # Somewhere in your program, run a worker (actually, it's often a
    # different program than the one deferring jobs for execution)
    app.run_worker(queues=["sums"])

The worker will run the job, which will create a text file named myfile with the result of the sum 3 + 5 (that's 8).

Similarly, from the command line:

export PROCRASTINATE_APP="mycode.app"

# Launch a job
procrastinate defer mycode.sum '{"a": 3, "b": 5}'

# Run a worker
procrastinate worker -q sums

Lastly, you can use Procrastinate asynchronously too:

import asyncio

import procrastinate

# Make an app in your code
app = procrastinate.App(connector=procrastinate.AiopgConnector())

# Define tasks using coroutine functions
@app.task(queue="sums")
async def sum(a, b):
    await asyncio.sleep(a + b)

async with app.open_async():
    # Launch a job
    await sum.defer_async(a=3, b=5)

    # Somewhere in your program, run a worker (actually, it's often a
    # different program than the one deferring jobs for execution)
    await app.run_worker_async(queues=["sums"])

There are quite a few interesting features that Procrastinate adds to the mix. You can head to the Quickstart section for a general tour or to the How-To sections for specific features. The Discussion section should hopefully answer your questions. Otherwise, feel free to open an issue.

The project is still quite early-stage and will probably evolve.

Note to my future self: add a quick note here on why this project is named "Procrastinate".

Where to go from here

The complete docs is probably the best place to learn about the project.

If you encounter a bug, or want to get in touch, you're always welcome to open a ticket.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].