This file helps AI agents work effectively on the rstream codebase.
rstream is a Python asyncio client for RabbitMQ Streams. It provides producers, consumers, super streams, and single active consumer support. The codebase is in the rabbitmq-community org.
- Language: Python 3.9+
- Runtime: asyncio
- Package manager: Poetry (
pyproject.toml) - Source:
rstream/(e.g.producer.py,consumer.py,superstream_consumer.py,amqp.py,client.py,schema.py) - Tests:
tests/(pytest, pytest-asyncio) - Examples:
docs/examples/(basic producers/consumers, super streams, SAC, TLS, etc.)
- Install:
poetry install - Tests:
make test— requires a running RabbitMQ Stream server (see README for Docker setup) - Linting/formatting: black, isort, flake8, mypy (config in
pyproject.toml,setup.cfg, and tooling flags in the Makefile / CI workflows)
- Formatting: Black (line length 110, no string normalization), isort (profile: black)
- Linting: flake8 (max line length 120; extend-ignore: E203, W503)
- Types: mypy with
ignore_missing_imports = true; excludevenv,.venv,compose - Prefer async/await; keep APIs consistent with existing producer/consumer patterns.
- Codecs: AMQP 1.0 (default, interoperable with other clients) and Binary (Python-to-Python). See README “Client Codecs”.
- Recovery: Producers and consumers support auto-reconnect via
recovery_strategy(e.g.BackOffRecoveryStrategy). - Breaking changes: Document in
CHANGELOG.mdunder a version heading with “Breaking changes” when changing or removing public APIs.
- Run tests and linters after changes.
- Update
CHANGELOG.mdfor user-facing or breaking changes. - Keep docstrings and README/examples in sync with API changes.
- For new features, consider adding or updating an example under
docs/examples/.