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.3.tar.gz
(1.9 kB
view details)
Built Distribution
File details
Details for the file asyncio-pipe-0.0.3.tar.gz
.
File metadata
- Download URL: asyncio-pipe-0.0.3.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/24.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.18 tqdm/4.36.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d1a65bca4e8b4ba87897c9cfb7ef5d8cb9cf1eacf8dc1bf1204d717ff4169c1 |
|
MD5 | b6f2de3a06a73919db01879fe307d535 |
|
BLAKE2b-256 | 72aac0e91e32d78d502f6877bfe8855774181a0e4f9be1dad86640fa3131dc01 |
File details
Details for the file asyncio_pipe-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: asyncio_pipe-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/24.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.18 tqdm/4.36.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62e3cfe872289f74cab68965d58c3c53cbb831b27492ccd044554f07043c7d88 |
|
MD5 | e40d218873cddbf0fe6cc71f20a29757 |
|
BLAKE2b-256 | 5e021f7125b95c4b5f5811f760c6e63b922619a7ce8e52067c3e9cff652191ba |