Creates an event bus.
Optionalcapacity: number | null
how many events a slow subscriber may fall behind before it starts missing them, rounded up to the next power of two and at most 1048576; 64 when not given.
How many events this endpoint lost by falling behind, as of its last completed wait.
Waits for the next event on this endpoint.
OptionaltimeoutMs: number | null
how long to wait before throwing; the next event is then left for the next call. Without it, the wait lasts until an event arrives.
Waits for the next event as text.
Throws if the event is not UTF-8 text.
OptionaltimeoutMs: number | null
how long to wait before throwing; the next event is then left for the next call. Without it, the wait lasts until an event arrives.
Publishes an event to every subscriber, this endpoint included: bytes, or text such as an event name.
It never waits: a subscriber that has fallen behind loses its oldest event rather than holding up the publisher.
Takes a publish-only handle on the same bus, for a part that announces and never reads.
Takes another endpoint on the same bus.
The new endpoint sees events published from now on, not those already sent, so subscribe before publishing anything it needs to see.
One endpoint on an event bus.
An endpoint both publishes and receives, and it receives what it publishes itself. Each subscriber needs its own, taken with
subscribe, because an endpoint only sees events published after it existed. OnlynextandnextTextwait: publishing and subscribing return at once, even while anexton the same endpoint is waiting.