grpcdc/eventbus library

Event bus (grpcdc.events.v1.EventBus): in-memory broker, client helpers, and tag matching. Wire messages and stubs are generated from proto/events.proto (events_messages, events_grpc_dc); the broker policy comes from the shared event-bus spec.

Delivery is at-most-once: each subscriber has a bounded queue (subscriberQueueCapacity) and drops its oldest events when it falls behind; stats reports the drops.

Note: the generated Tag is a closed Dart enum, so a Dart peer can only carry tag values present in its generated copy of events.proto. To use your own tags, copy events.proto, add values (1000+), and regenerate — the standard extension flow. Brokers in open-enum languages pass unknown tag numbers through unchanged.

Classes

EventBusBroker
In-memory grpcdc.events.v1.EventBus broker. Any peer can host it: register() it on a Server next to your own services, or call publishEvent directly in-process.
LocalSubscription
Handle for EventBusBroker.subscribeLocal: pull events in-process. take returns the next event (waiting up to the timeout), or null; dropped counts this subscription's drop-oldest losses.

Constants

subscriberQueueCapacity → const int

Functions

publishEvent(EventBusClient client, List<TagValue> tags, List<int> payload, [String publisherId = '']) → Future<int>
Publish through a generated EventBusClient; returns the broker-assigned sequence number.
subscribeEvents(EventBusClient client, List<TagValue> filterTags) → Future<EventBusSubscribeStream>
Subscribe through a generated EventBusClient; returns the receiving stream (listen to its responses, or close() it to unsubscribe).
tagBool(Tag tag, Object value) → TagValue
tagDouble(Tag tag, Object value) → TagValue
tagEnum(Tag tag, Object value) → TagValue
tagInt(Tag tag, Object value) → TagValue
tagsMatch(List<TagValue> eventTags, List<TagValue> filterTags) → bool
Containment match: the event is delivered when its tag list contains every (tag, value) pair of the filter. An empty filter matches everything.
tagString(Tag tag, Object value) → TagValue
tagValueKey(TagValue tv) → String
Stable key for one TagValue, e.g. "1|s:orders".