One endpoint on an event bus.
An endpoint both publishes and receives. Each subscriber needs its own, taken with subscribe, because an endpoint only sees events published after it existed.
subscribe
Creates an event bus.
how many events a slow subscriber may fall behind before it starts missing them.
Waits for the next event on this endpoint, or null once the bus closes.
null
Publishes an event to every subscriber.
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. Each subscriber needs its own, taken with
subscribe, because an endpoint only sees events published after it existed.