Skip to main content

Non-blocking IPC with Asyncio

Project description

Asyncio Pipe

This package allows you to read from a multiprocessing.Connection object without blocking an asyncio event loop.

The Connection class has the same API functions as multiprocessing.Connection.

Usage

import asyncio
import multiprocessing
import asyncio_pipe

async def reader(read):
    connection = asyncio_pipe.Connection(read)
    print(await connection.recv())

def writer(write):
    write.send('Hello World')

read, write = multiprocessing.Pipe(duplex=False)
writer_process = multiprocessing.Process(target=writer, args=(write,))
writer_process.start()
asyncio.get_event_loop().run_until_complete(reader(read))

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 asyncio-pipe, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size asyncio_pipe-0.0.1-py3-none-any.whl (2.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size asyncio-pipe-0.0.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

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