Module Algostream_infrastructure_event_bus.Subscription

Filter combinators and subscription handles.

type subscription_id = private int
module Filter : sig ... end

Compose a predicate over Event.t. Filters compile to closures evaluated once per dispatch, so they stay zero-allocation in the common case.

type t = private {
  1. id : subscription_id;
  2. filter : Filter.t;
  3. handler : Event_types.Event.t -> unit;
}
val create : id:subscription_id -> filter:Filter.t -> handler:(Event_types.Event.t -> unit) -> t
module Id_allocator : sig ... end

Allocator for subscription IDs. Thread-safe.

val id_to_int : subscription_id -> int

Reveal the integer behind a subscription_id, for logging only.