Socket
Socket
Sign inDemoInstall

queuepipeio

Package Overview
Dependencies
3
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    queuepipeio

A project that provides queue-based I/O functionality


Maintainers
1

Readme

QueuePipeIO and LimitedQueuePipeIO

This Python package provides two classes, QueuePipeIO and LimitedQueuePipeIO, that represent queue-based I/O objects. These classes are ideal for multi-threaded or asynchronous programming where data is produced in one thread or coroutine and consumed in another.

Installation

You can install this package from PyPI:

::

pip install queuepipeio

Usage

Here’s a basic example of how to use QueuePipeIO and LimitedQueuePipeIO:

.. code:: python

from queuepipeio import QueuePipeIO, LimitedQueuePipeIO

Define MB as a constant

MB = 1024 * 1024

Create a QueuePipeIO object

qpio = QueuePipeIO(chunk_size=8*MB)

Write data to the queue

qpio.write(b'Hello, world!')

Close the writer

qpio.close()

Read data from the queue

data = qpio.read()

print(data) # Outputs: b'Hello, world!'

Create a LimitedQueuePipeIO object with a memory limit

lqpio = LimitedQueuePipeIO(memory_limit=16MB, chunk_size=8MB)

Write data to the queue

lqpio.write(b'Hello, again!')

Close the writer

lqpio.close()

Read data from the queue

data = lqpio.read()

print(data) # Outputs: b'Hello, again!'

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc