threadloop
Tornado IOLoop Backed Concurrent Futures
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 threadloopuv
uv add threadlooppoetry
poetry add threadloopInstalling 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
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
pytest-tornadoA pytest plugin that provides fixtures and…
permissive · top 15,000 on PyPI
syncerSyncer converts async functions to synchronous…
permissive · top 15,000 on PyPI
async-stripeProvides an asynchronous wrapper around the…
permissive · top 15,000 on PyPI
greenbackAllows you to call async functions from…
permissive · top 5,000 on PyPI
greenletGreenlet provides lightweight coroutines for…
permissive · top 100 on PyPI
lupaLupa embeds Lua or LuaJIT runtimes into…
permissive · top 1,000 on PyPI
requests-futuresWraps the requests library to execute HTTP…
permissive · top 5,000 on PyPI
synchronicityWraps async functions, generators, and classes…
permissive · top 1,000 on PyPI
unsyncDecorator-based library that runs async…
permissive · top 15,000 on PyPI
pytest-tornasyncA pytest plugin that runs native async test…
permissive · top 15,000 on PyPI