Skip to main content

Low level event reactor for Pyjoyment with asyncio support.

Project description


Low level event reactor with asyncio support for Pyjoyment.


An asynchronous, event driver web framework for the Python programming language.

Pyjoyment provides own reactor which handles I/O and timer events in its own main event loop but it supports other loops, ie. libev or asyncio.



This module provides infrastructure for writing single-threaded concurrent code using coroutines, multiplexing I/O access over sockets and other resources, running network clients and servers, and other related primitives.

The asyncio module was designed in PEP3156. For a motivational primer on transports and protocols, see PEP3153.



Trollius is a portage of the asyncio project (PEP3156) on Python 2. Trollius works on Python 2.6-3.5.



Non-blocking TCP client/server

import Pyjo.Reactor.Asyncio
import Pyjo.IOLoop

# Listen on port 3000
def server(loop, stream, cid):

    def read(stream, chunk):
        # Process input chunk
        print("Server: {0}".format(chunk.decode('utf-8')))

        # Write response
        stream.write(b"HTTP/1.1 200 OK\x0d\x0a\x0d\x0a")

        # Disconnect client

# Connect to port 3000
def client(loop, err, stream):

    def read(stream, chunk):
        # Process input
        print("Client: {0}".format(chunk.decode('utf-8')))

    # Write request
    stream.write(b"GET / HTTP/1.1\x0d\x0a\x0d\x0a")

# Add a timer
def timeouter(loop):
    # Shutdown server

# Start event loop

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Pyjo-Reactor-Asyncio, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size Pyjo_Reactor_Asyncio-0.0.1-py2.py3-none-any.whl (7.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size Pyjo-Reactor-Asyncio-0.0.1.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page