Skip to content

Lightweight, asynchronous function execution in Python using AMQP.

License

Notifications You must be signed in to change notification settings

RSEmail/provoke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

provoke

Lightweight, asynchronous function execution in Python using AMQP. Provoke was inspired by Celery, but intends to be much smaller and less invasive.

Build Status Coverage Status Documentation Status

Installation

sudo pip install provoke

Usage

The provoke script manages a set of processes, each capable of pulling task messages from an AMQP queue and executing them. The script uses an external Python module, using setuptools Entry Points, to load the information about processes and tasks.

To try it out, you will need a basic RabbitMQ broker running on localhost. When you're ready, start up the provoke worker with the worker example plugin:

provoke example

In another terminal, use the client example to send a task for execution:

python -m provoke.example.client

Try running the client example with some command-line arguments, and pay attention to the different PIDs running the tasks.

As easy as that, you have four processes executing a simple task!

Definitely check out the source code for the worker example and client example to see how it's done.

Development

Start by creating a virtualenv in a clone of the repository:

virtualenv .venv
source .venv/bin/activate

Install the package in development mode. Note: Do not use sudo!

python setup.py develop

Finally, install test dependencies and run py.test:

pip install -r test/requirements.txt
pip install MySQL-python
py.test

About

Lightweight, asynchronous function execution in Python using AMQP.

Resources

License

Stars

Watchers

Forks

Packages

No packages published