Class MultiSplitter<T,K extends java.lang.Enum<K>>
- java.lang.Object
-
- io.smallrye.mutiny.operators.multi.split.MultiSplitter<T,K>
-
- Type Parameters:
T- the items typeK- the enumeration type
public class MultiSplitter<T,K extends java.lang.Enum<K>> extends java.lang.ObjectSplits aMultiinto several co-operatingMulti.Each split
Multireceives items based on a function that maps each item to a key from an enumeration.The demand of each split
Multiis independent. Items flow when all keys from the enumeration have a split subscriber, and until either one of the split has a0demand, 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 newMultiobjects, but given a keyKthen there can be only one active subscription. If there is already a subscriber forKthen any subscription request to aMultifor keyKresults in a terminal failure. Note that when a subscriber forKhas cancelled then a request to subscribe for aMultiforKcan succeed.If the upstream
Multihas already completed or failed, then any new subscriber will receive the terminal signal (seeMultiSubscriber.onCompletion()andMultiSubscriber.onFailure(Throwable)).Note on
Contextsupport: it is assumed that all split subscribers share the sameContextinstance, if any. TheContextis passed to the upstreamMultiwhen the first split subscription happens. When disjointContextare in use by the different split subscribers then the behavior of your code will be most likely incorrect.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Multi<T>get(K key)Get aMultifor a given key.java.lang.Class<K>keyType()Get the (enum) key type.
-