This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

tornadoist -currently- provides Mixins to execute code outside tornado.ioloop.IOLoop to avoid blocking. These are:

  • CeleryMixin: Celery Tasks
  • ProcessMixin: Functions in separate process

Both support results, avoids polling or timeouts. More info below.

Demo app included. (Celery with mongodb:// preconfigured in demo app)

CeleryMixin

CeleryMixin is a Mixin class to use with tornado.web.RequestHandler that provides a Tornado-like interface to running Celery tasks on TornadoServer.

HowTO

Using tornado.gen

from tornado import web, gen
from tornadoist import CeleryMixin

class CeleryHandler(tornado.web.RequestHandler, CeleryMixin):
    @web.asynchronous
    @gen.engine
    def get(self):
        result = yield gen.Task(self.add_task, some_task, 'somearg')
        self.write('Hello %s World!' % result)
        self.finish()

Or using explicit callback

class CeleryHandler(tornado.web.RequestHandler, CeleryMixin):
    @tornado.web.asynchronous
    def get(self):
        self.add_task(some_task, callback=self._on_result)

    def _on_result(self, result):
        do_something_with_result(result)
        self.finish()

ProcessMixin

ProcessMixin is a Mixin class to use with tornado.web.RequestHandler that provides a Tornado-like interface to running functions with multiprocessing.Process outside IOLoop.

HowTO

Using tornado.gen

from tornado import web, gen
from tornadoist import ProcessMixin

class ProcessHandler(tornado.web.RequestHandler, ProcessMixin):
    @tornado.web.asynchronous
    @tornado.gen.engine
    def get(self):
        result = yield tornado.gen.Task(self.add_task, my_blocking_function,
                                        'somearg', some_kwarg=42)
        self.write('Hello Process World! %s' % result)
        self.finish()
Release History

Release History

0.5.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tornadoist-0.5.2.tar.gz (4.3 kB) Copy SHA256 Checksum SHA256 Source Jun 9, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting