vedarthk / async_runner

Async Runner

Home Page:http://async-runner.rtfd.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Async Runner

Documentation Status

Async runner is a thin wrapper over Celery API. This will enable control over failed messages by moving them to separate queue (generally queue_name_error) and also allows to retry the task with the help of retry policy.

More can be found at documentation: https://async_runner.readthedocs.org

from async_runner import async_runner
async_runner.send_task(
    task_fn=func,  # task function can be python module path
    queue='queue_name',  # name of the queue
    args=(arg1, arg2, arg3, ),  # tuple/list of positional arguments to task function
    kwargs={'name': 'parameter'},  # dictionary with key word arguments to task function
    options={
        'max_retries': 3,  # maximum number of times the task is retried
        'retry_policy': {
            'retry_interval': 12  # interval between retires (in seconds)
        }
    }
)

TODO: Decouple from Django

About

Async Runner

http://async-runner.rtfd.org/

License:MIT License


Languages

Language:Python 83.9%Language:Makefile 16.1%