Description
Currently the spec states "A Publisher can serve multiple subscribers subscribed dynamically at various points in time. In the case of multiple subscribers the Publisher should respect the processing rates of all of its subscribers (possibly allowing for a bounded drift between them)."
I think this is a mistake to complicate the spec and require implementations to support multicasting and therefore management of subscriptions over time. In fact, I think it should expressly stick to unicast (new lifecycle per Subscription
).
Multicasting techniques should be layered on top by libraries, not required of the Publisher
instances themselves.
For example, each Subscriber
could result in a new network connection, open file, etc. This would be a basic implementation.
In Rx this greatly simplifies things and is a good separation of concern. Multicasting can be added and done with different behaviors such as replaying all of history, a portion of history, the last value only, or ignoring history and just starting from now onwards, etc.
In other words, someone providing me a Publisher
should not concern themselves with multiple subscriptions, how I want to multicast or other such things. If I subscribe it should start a new lifecycle, emit the data as I request it and stop when I unsubscribe.
This keeps the mental model clear, the Publisher
implementations simple and allows libraries a simple contract to interface with.