by ajdavis

ajdavis / toro

Synchronization primitives for Tornado coroutines

197 Stars 11 Forks Last release: Not found Other 202 Commits 9 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:



.. image::

:Info: Synchronization primitives for Tornado coroutines. :Author: A. Jesse Jiryu Davis


.. important:: Toro is completed and deprecated; its features have been merged into Tornado. Development of locks and queues for Tornado coroutines continues in Tornado itself.

.. image:: :target:


A set of locking and synchronizing primitives analogous to those in Python's

threading module
_ or Gevent's
, for use with Tornado's

.. _threading module:

.. _coros:

.. _gen.engine:


Tornado_ >= version 3.0.

.. _Tornado:


Here's a basic example (for more see the examples section of the docs):

.. code-block:: python

from tornado import ioloop, gen
import toro

q = toro.JoinableQueue(maxsize=3)

@gen.coroutine def consumer(): while True: item = yield q.get() try: print 'Doing work on', item finally: q.task_done()

@gen.coroutine def producer(): for item in range(10): yield q.put(item)

producer() consumer() loop = ioloop.IOLoop.instance()

block until all tasks are done

q.join().add_done_callback(loop.stop) loop.start()


You will need Sphinx_ and GraphViz_ installed to generate the documentation. Documentation can be generated like:

.. code-block:: console

$ sphinx-build doc build

.. _Sphinx:

.. _GraphViz:



python test
in the root directory.

Toro boasts 100% code coverage, including branch-coverage!

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.