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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asyncio-pipe-0.0.2.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for asyncio_pipe-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7527438290d14897679a66ffc55c30ff322334131f84515ddc5f1c90d62f03d5 |
|
MD5 | 29e2f7c6fe807cb2de0985d869008552 |
|
BLAKE2b-256 | 547ae1dfb0b9fc722ff1a64e222e51b7c6141dac379a33d7b5bac5c92af3b579 |