Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install tornado-celery

How to install tornado-celery

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install tornado-celery
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.3.0 Available View build log
Lastest release
version 0.3.0 on Jan 9th, 2014

tornado-celery is a non-blocking Celery client for Tornado web framework


Calling Celery tasks from Tornado RequestHandler:

from tornado import gen, web
import tcelery, tasks


class AsyncHandler(web.RequestHandler):
    def get(self):
        tasks.echo.apply_async(args=['Hello world!'], callback=self.on_result)

    def on_result(self, response):

Calling tasks with generator-based interface:

class GenAsyncHandler(web.RequestHandler):
    def get(self):
        response = yield gen.Task(tasks.sleep.apply_async, args=[3])

NOTE: Currently callbacks only work with AMQP backend

tornado-celery can be launched as a web server:

$ python -m tcelery --port=8888

Execute a task asynchronously:

$ curl -X POST -d '{"args":["hello"]}' http://localhost:8888/apply-async/tasks.echo/
{"task-id": "a24c9e38-4976-426a-83d6-6b10b4de7ab1", "state": "PENDING"}

Get the result:

$ curl http://localhost:8888/tasks/result/a24c9e38-4976-426a-83d6-6b10b4de7ab1/
{"task-id": "a24c9e38-4976-426a-83d6-6b10b4de7ab1", "state": "SUCCESS", "result": "hello"}

Execute a task and get the result:

$ curl -X POST -d '{"args":[1,2]}' http://localhost:8888/apply/tasks.add/
{"task-id": "fe3cc5a5-d11b-4b17-a6e2-e7fd2fba7ec6", "state": "SUCCESS", "result": 3}

Execute a task with timeout:

$ curl -X POST -d '{"args":[5],"timeout":1}' http://localhost:8888/apply/tasks.sleep/
{"task-id": "9ca78e26-bbb2-404c-b3bb-bc1c63cbdf41", "state": "REVOKED"}


To install, simply:

$ pip install tornado-celery

Subscribe to package updates

Last updated Jan 9th, 2014

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.