Skip to content

HelloGrayson/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

Contributors 4

  •  
  •  
  •  
  •