skillfed

threadloop

Tornado IOLoop Backed Concurrent Futures

threadloop v1.0.2 244.0K downloads/30d#8,769 on PyPI9
Permissive license MIT Abandoned released

What it is and what it does

ThreadLoop wraps Tornado's IOLoop inside a background thread, letting you call Tornado coroutines from ordinary synchronous Python code and retrieve their results as futures. It bridges the gap between async Tornado code and synchronous callers by managing the event loop lifecycle automatically.

The package was designed for scenarios where you have a Tornado-based library or service but need to call it from synchronous code without blocking the main thread. It uses a context manager to set up and tear down the IOLoop thread cleanly. However, the project is no longer maintained—the last release was in 2016 and the last commit in 2022—so it is not tested against modern versions of Tornado or Python.

Use it for:

  • Call a Tornado-based async library from a synchronous script or application without rewriting the library.
  • Integrate Tornado coroutines into a legacy synchronous codebase that cannot be fully converted to async.
  • Test Tornado coroutines in a synchronous test suite without restructuring the test framework.
  • Prototype or debug Tornado code interactively in a synchronous Python shell or notebook.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Runs Tornado coroutines from synchronous Python code by wrapping an IOLoop in a thread, allowing you to call async functions and wait for their results.

No, unless you are maintaining legacy code locked to Python 2.7 or early Python 3 with an old Tornado version. The package is abandoned, untested with modern Tornado, and offers no maintenance path forward. Modern alternatives—such as asyncio bridges, async/await patterns, or Tornado's own async support—are better choices for new code.

Install

threadloop on PyPI

pip

pip install threadloop

uv

uv add threadloop

poetry

poetry add threadloop

Installing threadloop

Before you install

Low install friction, but the package is abandoned—last release was 2016-04-01 and last commit 2022-05-17. No recent maintenance or updates; use only if your codebase is locked to older Tornado versions.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.

Quickstart

pip install threadloop

from threadloop import ThreadLoop
from tornado import gen

@gen.coroutine
def my_coroutine():
    yield gen.sleep(1)
    raise gen.Return("done")

with ThreadLoop() as loop:
    future = loop.submit(my_coroutine)
    print(future.result())

Requires Tornado; designed for Python 2.7 and early Python 3 versions (3.3–3.5 per classifiers). Compatibility with modern Tornado and Python versions is unverified.

Verify before relying

  • Whether this package works with modern Tornado versions (current or recent releases).
  • Whether it works reliably with Python 3.6+ or only the declared versions (3.3–3.5).
  • Whether the threading model is safe for production use or carries known race conditions.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — tornado
Maintenance abandoned — 3,787 days since the last release
Last repo commit
First released
Downloads 243,975/month — #8,769 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: threadloop-1.0.2-py2-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

tornado coroutines from sync coderun async tornado in threadstornado ioloop wrappersynchronous tornado interfacetornado concurrent futuresbridge tornado async to sync
tornadoasync-bridgeabandoned

More Application Frameworks packages