Skip to main content

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.6

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

Source distribution (sdist)

Source distribution for moat-lib-stream 0.3.6
File Size Uploaded
moat_lib_stream-0.3.6.tar.gz 27.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moat-lib-stream 0.3.6
File Interpreter ABI Platform
moat_lib_stream-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size: 59.0 kB

Release files / moat_lib_stream-0.3.6.tar.gz

Download URL moat_lib_stream-0.3.6.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f99ad131bd2667752ada5b43302283dfc1bad0f8d4ee5395d46b46bd8ce9aa25
BLAKE2b-256 checksum
How to use checksums
04d50eb2a0b250d26168061281af70bc88126aa66c75efb47ff8b7e79f9c2e67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / moat_lib_stream-0.3.6-py3-none-any.whl

Download URL moat_lib_stream-0.3.6-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
592e3318a1dbd355f76edd0e4a3e7f433c8e0c9475024d06256f2daf474a59a9
BLAKE2b-256 checksum
How to use checksums
0ddb2135c12bdaf6d6b9bd13ee80a2b6ab0955e20a80b5d9ef5d9ea1b396ea99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

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