Stream Infrastructure
% start synopsis % start main
This module provides base classes for handling data streams in a structured manner.
% end synopsis
Overview
This package implements infrastructure for building layered communication stacks:
- BaseMsg - Message-based communication (Python objects)
- BaseBlk - Block-based communication (delimited bytestrings)
- BaseBuf - Buffer-based communication (undelimited bytestreams)
Layered Communication Stacks
Build communication stacks by layering protocols:
from moat.lib.stream import StackedBlk
class Compression(StackedBlk):
async def snd(self, blk):
compressed = compress(blk)
await self.s.send(compressed)
async def rcv(self):
blk = await self.s.recv()
return decompress(blk)
# Stack layers
link = SerialLink(cfg) # BaseBuf
link = Packetizer(link, cfg) # StackedBlk
link = Compressor(link, cfg) # StackedBlk
link = Codec(link, cfg) # StackedMsg
async with link:
await link.send({"data": "hello"})
% end main
License
This project is part of the MoaT ecosystem and is licensed under the same terms.
Metadata
Release files for moat-lib-stream 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| moat_lib_stream-0.3.4.tar.gz | 27.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moat_lib_stream-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.4 kB
Release files / moat_lib_stream-0.3.4.tar.gz
| Download URL | moat_lib_stream-0.3.4.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16f3c6a16715dc23c22886c3a7daf47b28964529addd8a2bff14c2a7d4b99d76
|
|
BLAKE2b-256 checksum How to use checksums |
93a161ec4cef348128800284616502c62ea5fbcab44d3121660c1326f6ff4c63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / moat_lib_stream-0.3.4-py3-none-any.whl
| Download URL | moat_lib_stream-0.3.4-py3-none-any.whl |
|---|---|
| Size | 31.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0db8dabfc1575a2614610908bb6c4e0967f86ab0b7b5c60db74d2f44cf0dd45
|
|
BLAKE2b-256 checksum How to use checksums |
2420bb016f8af3622371244be45b277280f1c8130b7b7a02e8c685b5baec14f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|