Skip to main content

os-aio-pod-channel

Build Status codecov PyPI - Python Version PyPI

A os-aio-pod component for transporting.

This lib is designed as a component of os-aio-pod framework. It is mainly used for transporting data between TCP endpoints. The os-aio-pod built-in TCP server is used as background drive engine. With the middleware/extension mechanism, you can easily build aio programs like Proxy or MITM server.

Install

pip install os-aio-pod-channel

Conception

  • Engine: Used to adapt with os-aio-pod framework, drive the whole event loop. It is also an access point for the components communicate with each other.
  • Endpoint: Each incoming or outgoing connection is called endpoint. typically, just engine use it's APIs to read, write data or close connection.
  • Channel: When incoming and outgoing endpoints all connected, a channel between them established. The engine is in charge of it's inner transporting status.
  • Middleware: Used to communicate with channel and handle data.
  • Extension: Used for functional expansion. Can be accessed from engine instance.

Usage

This lib is used with os-aio-pod. Typically, you should define a configure file and run with os-aio-pod command line tool.

A minimal configure file (do nothing, just accept TCP connection, read and drop):

# config.py
BEANS  = [
    {
        'core'  : 'os_aio_pod.contrib.tcp_server.TCPServerAdapter',
        'server': 'os_aio_pod_channel.engine.Engine',
        'MIDDLEWARES': [],
        'EXTENSIONS': [],
    }
]
os-aio-pod run -c config.py --debug

Middleware

When data transporting or channel closed the corresponding method of middlewares will be invoked in specific order. You should inherit from os_aio_pod_channel.middleware.Middleware and configure class, id and other parameters of each middleware in MIDDLEWARES list.

Extension

You shold inherit from os_aio_pod_channel.extension.Extension and config class, name and other parameters of each extension in EXTENSIONS list. You can get extension by engine.extension_manager.get_extension(extension_name)

Unit Tests

tox

License

MIT licensed.

Metadata

Release files for os-aio-pod-channel 0.1.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for os-aio-pod-channel 0.1.13
File Size Uploaded Provenance
os-aio-pod-channel-0.1.13.tar.gz 11.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for os-aio-pod-channel 0.1.13
File Interpreter ABI Platform
os_aio_pod_channel-0.1.13-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / os-aio-pod-channel-0.1.13.tar.gz

Download URL os-aio-pod-channel-0.1.13.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ab95656757100365953087180bb3a55c8c8f5f446eab37006df08441cdb299bc
BLAKE2b-256 checksum
How to use checksums
c0fe9eedb41fbb22e0bccd8d5291050478393c3ded00f2f98d8e2eb23c44e537
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.8

Release files / os_aio_pod_channel-0.1.13-py3-none-any.whl

Download URL os_aio_pod_channel-0.1.13-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f30b170dbfc1150246d8e0acca689ca90edc24e8a8a6c67d0c655f9e920bda4b
BLAKE2b-256 checksum
How to use checksums
20b724c337b9f6086f71a6e3950f8dd1d3c56cf7cf34712fc603bc009f6b4ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.8

Security for os-aio-pod-channel 0.1.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page