- All Superinterfaces:
MutinyInterceptor
-
Field Summary
Fields inherited from interface io.smallrye.mutiny.infrastructure.MutinyInterceptor
DEFAULT_ORDINAL -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Multi<T> onMultiCreation(Multi<T> multi) Method called when a new instance ofMultiis created.default <T> Flow.Subscriber<? super T> onSubscription(Flow.Publisher<? extends T> instance, Flow.Subscriber<? super T> subscriber) Method called when a subscriber subscribes to aMulti.Methods inherited from interface io.smallrye.mutiny.infrastructure.MutinyInterceptor
ordinal
-
Method Details
-
onMultiCreation
Method called when a new instance ofMultiis created. If can return a newMulti, or the passedMulti(default behavior) if the interceptor is not interested by thisMulti.One use case for this method is the capture of a context at creation time (when the method is called) and restored when a subscriber subscribed to the produced
multi. It is recommended to extendAbstractMultito produce a newMultiinstance.- Type Parameters:
T- the type of item produced by the multi- Parameters:
multi- the created multi- Returns:
- the passed multi or a new instance, must not be
null
-
onSubscription
default <T> Flow.Subscriber<? super T> onSubscription(Flow.Publisher<? extends T> instance, Flow.Subscriber<? super T> subscriber) Method called when a subscriber subscribes to aMulti. This method lets you substitute the subscriber.- Type Parameters:
T- the type of item- Parameters:
instance- the instance of publishersubscriber- the subscriber- Returns:
- the subscriber to use instead of the passed one. By default, it returns the given subscriber.
-