Package io.servicetalk.concurrent.api
Interface SwitchMapSignal<T>
- Type Parameters:
T- Type of the data.
public interface SwitchMapSignal<T>
A signal containing the data from a series of
Publishers switched in a serial fashion.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueon the first signal from a newPublisher.onNext()Get the data that was delivered toPublisherSource.Subscriber.onNext(Object).static <T,R> Function<T, Publisher<? extends SwitchMapSignal<R>>> toSwitchFunction(Function<? super T, ? extends Publisher<? extends R>> function)
-
Method Details
-
isSwitched
boolean isSwitched()Returnstrueon the first signal from a newPublisher.- Returns:
trueon the first signal from a newPublisher.
-
onNext
Get the data that was delivered toPublisherSource.Subscriber.onNext(Object).- Returns:
- the data that was delivered to
PublisherSource.Subscriber.onNext(Object).
-
toSwitchFunction
static <T,R> Function<T,Publisher<? extends SwitchMapSignal<R>>> toSwitchFunction(Function<? super T, ? extends Publisher<? extends R>> function) Convert from a regularFunctionto aFunctionthat emitsSwitchMapSignal.This function has state, if used in an operator chain use
Publisher.defer(Supplier)so the state is unique per each subscribe.- Type Parameters:
T- The input data type.R- The resulting data type.- Parameters:
function- The original function to convert.- Returns:
- a
Functionthat emitsSwitchMapSignal.
-