File: README.rst

package info (click to toggle)
python-threadloop 1.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 108 kB
  • sloc: python: 300; makefile: 22
file content (32 lines) | stat: -rw-r--r-- 897 bytes parent folder | download
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