1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
ThreadLoop
==========
|build-status| |coverage| |pypi|
Run Tornado Coroutines from Synchronous Python.
.. code:: python
from threadloop import ThreadLoop
from tornado import gen
@gen.coroutine
def coroutine(greeting="Goodbye"):
yield gen.sleep(1)
raise gen.Return("%s World" % greeting)
with ThreadLoop() as threadloop:
future = threadloop.submit(coroutine, "Hello")
print future.result() # Hello World
.. |build-status| image:: https://travis-ci.org/breerly/threadloop.svg?branch=master
:target: https://travis-ci.org/breerly/threadloop
.. |coverage| image:: https://coveralls.io/repos/breerly/threadloop/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/breerly/threadloop?branch=master
.. |pypi| image:: https://badge.fury.io/py/threadloop.svg
:target: http://badge.fury.io/py/threadloop
|