Skip to main content

A distributed task runner

Project description

Kuyruk is a simple and easy way of distributing tasks to run on servers.

It uses RabbitMQ as message broker and depends on Pika which is a pure-Python RabbitMQ client library.

How to install?

Kuyruk is available on PyPI.

$ pip install kuyruk

How to run tests?

Normally you don’t need this but it is easy. kuyruk/test directory contains files of both unit and integration tests. Make sure that RabbitMQ is running before running tests. Tests also run on Travis CI automatically on push.

https://travis-ci.org/cenkalti/kuyruk.png
$ git clone git://github.com/cenkalti/kuyruk.git
$ cd kuyruk
$ pip install -r kuyruk/test/requirements.txt
$ nosetests

How to define tasks?

Instantiate a Kuyruk object somewhere. Then just put a kuyruk.task decorator on top of your function that you want to run in background. After decorating, when you call the function it will send the task to default queue instead of running the function. Since Kuyruk does not support a result backend yet you should not be using the return value of the function.

from kuyruk import Kuyruk

kuyruk = Kuyruk()

@kuyruk.task
def echo(message):
    print message

# This will send a message to queue
echo('Hello, Kuyruk.')

How to run the worker?

Running the worker command with no parameters is enough for processing the tasks in the default queue.

$ kuyruk worker

Where is the documentation?

Here it is: http://kuyruk.readthedocs.org

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

Kuyruk-0.13.3.tar.gz (28.0 kB view details)

Uploaded Source

File details

Details for the file Kuyruk-0.13.3.tar.gz.

File metadata

  • Download URL: Kuyruk-0.13.3.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Kuyruk-0.13.3.tar.gz
Algorithm Hash digest
SHA256 0f9fd6ad1782d6b808632070822615049c0995de88800b14910d776491021461
MD5 7cec9f2b5b4b797f09f1f3264e8a04cc
BLAKE2b-256 2b9e78be58e3e9f488b7fb0a3ae279931562eef2da604e14e8b71fe62e6a03d7

See more details on using hashes here.

Supported by

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