Skip to main content

A simple library for asynchronous communication with standard I/O.

Project description

aiostd

A simple library for asynchronous communication with standard I/O

The library employs asyncio's I/O multiplexing, which enables efficient I/O operations by monitoring multiple file descriptors simultaneously without the overhead of creating separate threads.

Installation

pip install -U aiostd

Usage

from aiostd import open_io_stream
import sys

async def main():
    reader, writer = await open_io_stream(sys.stdin, sys.stdout)

    async for line in reader:
        writer.write(line)
        await writer.drain()

asyncio.run(main())

Project details


Download files

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

Source Distribution

aiostd-0.0.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

aiostd-0.0.1-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page