Expand description
Protocol-agnostic routing engine.
The core never parses a payload and never names a protocol. Adapters
map native frames onto Envelope values and subscribe through
Engine. Matching is a RouteKey (topic plus optional type
hint). Fan-out is try_send: a slow subscriber loses the message
rather than blocking the publisher.
Adding a protocol means adding an adapter crate, not changing this
one. The plugin contract is oa_gateway_adapter::Adapter; the
walkthrough is docs/writing-an-adapter.md.
Modulesยง
- engine ๐
- envelope ๐
- headers ๐Gateway-wide envelope header names (
oag.*). - ids ๐Newtypes so an adapter id, a subscription id, and a message id cannot be mixed at the call site.
- route ๐Addressing key used by
crate::Engine.
Structsยง
- Id of one running adapter instance.
- Label for opaque payload bytes. The engine does not interpret it.
- One fan-out of an
Envelopeto one subscription. - Shared, protocol-neutral pub/sub router.
- Running counters for publish fan-out.
- Protocol-agnostic unit of data that crosses the engine.
- Id assigned to an
crate::Envelopewhen it is constructed. - Result of one
Engine::publishfan-out. - Topic plus an optional type hint.
- Id of one subscription inside one adapter.
- Composite key for a subscription owned by one adapter.
Enumsยง
- Errors from
Engine::subscribeandEngine::unsubscribe.
Constantsยง
- Capacity of each subscriber delivery channel.
- Envelope
crate::MessageId, written on outbound frames. - Which adapter last published this envelope onto the engine.
- Engine topic, copied onto a native frame when the protocol has a place for it.
- Engine type hint, copied onto a native frame when present.