Package io.servicetalk.concurrent.api
Interface SingleOperator<T,R>
-
- Type Parameters:
T- Type of the result of theSinglethis operator is applied.R- Type of the result of this operator.
- All Superinterfaces:
java.util.function.Function<SingleSource.Subscriber<? super R>,SingleSource.Subscriber<? super T>>
- All Known Implementing Classes:
BeforeFinallyHttpOperator
public interface SingleOperator<T,R> extends java.util.function.Function<SingleSource.Subscriber<? super R>,SingleSource.Subscriber<? super T>>
An operator contract for aSingle. Logically an operator sits between aSingleand aSingleSource.Subscriberand hence it has two responsibilities:- Subscribe to the
Singleon which this operator is applied. - Accept a
SingleSource.Subscriberthat subscribes to this operator.
Functionthat takes aSingleSource.Subscriberand returns aSingleSource.Subscriber. TheSingleSource.Subscriberthat is passed to thisFunctionis the one that has subscribed to this operator. TheSingleSource.Subscriberthat is returned by thisFunctionis the one that should be used to subscribe to theSingleon which this operator is applied.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SingleSource.Subscriber<? super T>apply(SingleSource.Subscriber<? super R> subscriber)Implementation of this operator.
-
-
-
Method Detail
-
apply
SingleSource.Subscriber<? super T> apply(SingleSource.Subscriber<? super R> subscriber)
Implementation of this operator. SeeSingleOperatorfor definition of an operator.- Specified by:
applyin interfacejava.util.function.Function<T,R>- Parameters:
subscriber-SingleSource.Subscriberthat subscribed to this operator.- Returns:
SingleSource.Subscriberthat is used to subscribe to theSinglethat this operator is applied to.
-
-