Skip to main content

Twisted is a production-quality event-driven networking engine with built-in support for many protocols (HTTP, DNS, SSH, IMAP), and a large ecosystem of 3rd party libraries. Twisted works on both Python 2 and a subset of functionality is supported on Python 3.

Asyncio (also known as Tulip) is a new networking event loop implementation included with Python 3.4, whose core networking layer was modeled on Twisted APIs. Trollius is a backport of Asyncio to Python 2.

txtulip aims to allow using both Twisted and Tulip/Asyncio/Trollius in the same Python process by:

  1. Running the Twisted reactor on top of Asyncio’s event loop.

  2. Alternatively, running the Asyncio event loop on top of Twisted’s reactor (work in progress).

  3. Hooking up Deferreds and Futures (planned, no code yet).

txtulip is licensed under the MIT open source license, and maintained by Itamar Turner-Trauring.

txtulip can be downloaded at https://pypi.python.org/pypi/txtulip

Bugs and feature requests shoudl be filed at https://github.com/itamarst/txtulip

Status

This package is experimental; pull requests are welcome.

Twisted on Asyncio

The vast majority of the Twisted test suite does pass on the new reactor. The remaining test failures are due to:

  • Fragile or buggy tests in Twisted’s test suite.

  • Bugs in asyncio that do not exist in Twisted, especially in the epoll event loop (lack of support for large values in call_later, lack of support for filesystem files which can happen e.g. when they are hooked up to stdin/out).

  • Potentially, bugs in txtulip.

Requirements

  • POSIX platform

  • Either: Python 3.4, Twisted 14.0 and trunk

  • Or: Python 2.7, Trollius, and a modern version of Twisted

Usage

Twisted on Asyncio

Using txtulip is easy. Before importing any Twisted code, install the txtulip reactor:

from txtulip.reactor import install
install()

See examples/echoserv.py for an example.

On Python 2 (or once trial/twistd command line tools are ported to Python 3), you can also specify trial --reactor=tulip or twistd --reactor=tulip.

Release files for txtulip 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for txtulip 0.1.0
File Size Uploaded
txtulip-0.1.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for txtulip 0.1.0
File Interpreter ABI Platform
txtulip-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.1 kB

Release files / txtulip-0.1.0.tar.gz

Download URL txtulip-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f66b0e1062c4915f0eade9eaf72542d3541725985e77415c9716dd3300677ee1
BLAKE2b-256 checksum
How to use checksums
f61b6bdad3b0bd53f4b98bf5aa10ead9d9044b518162bc739d7fae733049c149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / txtulip-0.1.0-py2.py3-none-any.whl

Download URL txtulip-0.1.0-py2.py3-none-any.whl
Size 8.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ab72418eea2461840f530e0ef9e300cd014a4b6da81d38ed0be9561dc258152d
BLAKE2b-256 checksum
How to use checksums
73292bb11fb97fde40588941ae5b6dc0854ec7497ea18b4f7cf42960ff0d6185
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page