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
Publisher
s switched in a serial fashion.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
on 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()Returnstrue
on the first signal from a newPublisher
.- Returns:
true
on 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 regularFunction
to aFunction
that 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
Function
that emitsSwitchMapSignal
.
-