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:
Function<SingleSource.Subscriber<? super R>,
SingleSource.Subscriber<? super T>>
- All Known Implementing Classes:
BeforeFinallyHttpOperator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface SingleOperator<T,R>
extends Function<SingleSource.Subscriber<? super R>,SingleSource.Subscriber<? super T>>
An operator contract for a
Single
.
Logically an operator sits between a Single
and a SingleSource.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 a SingleSource.Subscriber
and returns a
SingleSource.Subscriber
.
The SingleSource.Subscriber
that is passed to this Function
is the one that has subscribed to this operator.
The SingleSource.Subscriber
that is returned by this Function
is the one that should be used to subscribe to the
Single
on which this operator is applied.-
Method Summary
Modifier and TypeMethodDescriptionSingleSource.Subscriber<? super T>
apply
(SingleSource.Subscriber<? super R> subscriber) Implementation of this operator.
-
Method Details
-
apply
Implementation of this operator. SeeSingleOperator
for definition of an operator.- Specified by:
apply
in interfaceFunction<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.
-