Class MultiSplitter<T,K extends Enum<K>>
- Type Parameters:
T- the items typeK- the enumeration type
Multi into several co-operating Multi.
Each split Multi receives items based on a function that maps each item to a key from an enumeration.
The demand of each split Multi is independent.
Items flow when all keys from the enumeration have a split subscriber, and until either one of the split has a 0
demand,
or when one of the split subscriber cancels.
The flow resumes when all keys have a subscriber again, and when the demand for each split is strictly positive.
Calls to get(Enum) result in new Multi objects, but given a key K then there can be only one
active subscription. If there is already a subscriber for K then any subscription request to a Multi for key
K results in a terminal failure.
Note that when a subscriber for K has cancelled then a request to subscribe for a Multi for K can
succeed.
If the upstream Multi has already completed or failed, then any new subscriber will receive the terminal signal
(see MultiSubscriber.onCompletion() and MultiSubscriber.onFailure(Throwable)).
Note on Context support: it is assumed that all split subscribers share the same Context instance, if any.
The Context is passed to the upstream Multi when the first split subscription happens.
When disjoint Context are in use by the different split subscribers then the behavior of your code will be most
likely incorrect.
-
Constructor Summary
Constructors -
Method Summary