Package io.servicetalk.concurrent.api
Interface SingleOperator<T,R>
-
- Type Parameters:
T
- Type of the result of theSingle
this 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 aSingle
and aSingleSource.Subscriber
and hence it has two responsibilities:- Subscribe to the
Single
on which this operator is applied. - Accept a
SingleSource.Subscriber
that subscribes to this operator.
Function
that takes aSingleSource.Subscriber
and returns aSingleSource.Subscriber
. TheSingleSource.Subscriber
that is passed to thisFunction
is the one that has subscribed to this operator. TheSingleSource.Subscriber
that is returned by thisFunction
is the one that should be used to subscribe to theSingle
on 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. SeeSingleOperator
for definition of an operator.- Specified by:
apply
in interfacejava.util.function.Function<T,R>
- Parameters:
subscriber
-SingleSource.Subscriber
that subscribed to this operator.- Returns:
SingleSource.Subscriber
that is used to subscribe to theSingle
that this operator is applied to.
-
-