Coder Social home page Coder Social logo

kuyruk's Introduction

Kuyruk

image

image

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.

$ 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

Bitdeli badge

kuyruk's People

Contributors

bitdeli-chef avatar cenkalti avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.