Package io.servicetalk.concurrent.api
Interface PublisherToSingleOperator<T,R>
-
- Type Parameters:
T- Type of items emitted by thePublisherthis operator is applied.R- Type of items emitted by this operator.
- All Superinterfaces:
java.util.function.Function<SingleSource.Subscriber<? super R>,PublisherSource.Subscriber<? super T>>
public interface PublisherToSingleOperator<T,R> extends java.util.function.Function<SingleSource.Subscriber<? super R>,PublisherSource.Subscriber<? super T>>
An operator contract for aPublishertoSingleconversion. Logically an operator sits between aPublisherand aPublisherSource.Subscriberand hence it has two responsibilities:- Subscribe to the
Publisheron which this operator is applied. - Accept a
SingleSource.Subscriberwhich is converted to aPublisherSource.Subscriberthat subscribes to this operator.
Functionthat takes aSingleSource.Subscriberand returns aPublisherSource.Subscriber. TheSingleSource.Subscriberthat is passed to thisFunctionis the one that has subscribed to theSingleoperator. ThePublisherSource.Subscriberthat is returned by thisFunctionis the one that should be used to subscribe to thePublisheron which this operator is applied.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PublisherSource.Subscriber<? super T>apply(SingleSource.Subscriber<? super R> subscriber)Implementation of this operator.
-
-
-
Method Detail
-
apply
PublisherSource.Subscriber<? super T> apply(SingleSource.Subscriber<? super R> subscriber)
Implementation of this operator. SeePublisherToSingleOperatorfor definition of an operator.- Specified by:
applyin interfacejava.util.function.Function<T,R>- Parameters:
subscriber-SingleSource.Subscriberthat subscribed to this operator.- Returns:
PublisherSource.Subscriberthat is used to subscribe to thePublisherthat this operator is applied to.
-
-