Expand description
The C ABI for the in-process event bus.
These functions wrap [pamoja_bus] for callers that reach the SDK through
the flat C boundary: one publisher, many subscribers, inside a single
process. It is how the parts of a gateway talk to each other without knowing
about each other, so a sampler can announce a reading and whatever cares
about readings picks it up.
The Rust bus carries any cloneable event; a C ABI has no such parameter, so
this one carries bytes. That is the shape every binding already exchanges,
and a caller who wants structure encodes it with
crate::codec on the way in.
Every call on an endpoint takes it by shared pointer, and an endpoint may be used from several threads at once: a publish or a subscribe runs while a next waits on another thread, and two nexts on one endpoint take turns.
Structs§
- Pamoja
Event Bus - An opaque handle to one endpoint on an event bus.
- Pamoja
Event Publisher - An opaque handle that publishes to a bus and has no queue of its own.
Functions§
- pamoja_
event_ ⚠bus_ free - Releases an event bus endpoint.
- pamoja_
event_ ⚠bus_ missed - Counts the events this endpoint lost by falling behind.
- pamoja_
event_ bus_ new - Creates an event bus.
- pamoja_
event_ ⚠bus_ next - Waits for the next event on this endpoint.
- pamoja_
event_ ⚠bus_ next_ within - Waits for the next event on this endpoint, giving up after a time limit.
- pamoja_
event_ ⚠bus_ publish - Publishes an event to every subscriber, this endpoint included.
- pamoja_
event_ ⚠bus_ publisher - Takes a publish-only handle on the same bus.
- pamoja_
event_ ⚠bus_ subscribe - Takes another endpoint on the same bus.
- pamoja_
event_ ⚠publisher_ clone - Takes another publisher on the same bus, for another part that announces.
- pamoja_
event_ ⚠publisher_ free - Releases a publisher.
- pamoja_
event_ publisher_ new - Creates a bus with no subscribers yet, and a publisher on it.
- pamoja_
event_ ⚠publisher_ publish - Hands an event to every current subscriber.
- pamoja_
event_ ⚠publisher_ subscribe - Subscribes to the bus a publisher publishes on.