java.lang.Object
io.smallrye.mutiny.groups.MultiBroadcast<T>
- Type Parameters:
T- the type of item
Makes the upstream
Multi be able to broadcast its events (items, failure, and
completion) to multiple subscribers.
Broadcast transforms the upstream into a hot streams meaning that late subscriber won't see all the events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBroadcasts the events of the upstreamMultito all the subscribers.toAtLeast(int numberOfSubscribers) Broadcasts the events of the upstreamMultito several subscribers.Indicates that the subscription to the upstreamMultiis cancelled once all the subscribers have cancelled their subscription.Indicates that the subscription to the upstreamMultiis cancelled once all the subscribers have cancelled their subscription.
-
Constructor Details
-
MultiBroadcast
-
-
Method Details
-
toAllSubscribers
Broadcasts the events of the upstreamMultito all the subscribers. Subscribers start receiving the events as soon as they subscribe.- Returns:
- the
Multiaccepting several subscribers
-
toAtLeast
Broadcasts the events of the upstreamMultito several subscribers. Subscribers start receiving the events when at leastnumberOfSubscriberssubscribes to the producedMulti.- Parameters:
numberOfSubscribers- the number of subscriber requires before subscribing to the upstream multi and start dispatching the events. Must be strictly positive.- Returns:
- the
Multiaccepting several subscribers
-
withCancellationAfterLastSubscriberDeparture
Indicates that the subscription to the upstreamMultiis cancelled once all the subscribers have cancelled their subscription.- Returns:
- this
MultiBroadcast.
-
withCancellationAfterLastSubscriberDeparture
@CheckReturnValue public MultiBroadcast<T> withCancellationAfterLastSubscriberDeparture(Duration delay) Indicates that the subscription to the upstreamMultiis cancelled once all the subscribers have cancelled their subscription. Before cancelling it wait for a grace period ofdelay. If any subscriber subscribes during this period, the cancellation will not happen.- Parameters:
delay- the delay, must not benull, must be positive- Returns:
- this
MultiBroadcast.
-