Skip to content

wisdom-garden/threadloop

 
 

Repository files navigation

ThreadLoop

build-status coverage pypi

Run Tornado Coroutines from Synchronous 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

About

Tornado IOLoop Backed Concurrent Futures

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 96.7%
  • Makefile 3.3%