Package io.servicetalk.concurrent.api
Interface PublisherOperator<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<PublisherSource.Subscriber<? super R>,PublisherSource.Subscriber<? super T>>
public interface PublisherOperator<T,R> extends java.util.function.Function<PublisherSource.Subscriber<? super R>,PublisherSource.Subscriber<? super T>>
An operator contract for aPublisher. Logically an operator sits between aPublisherand aPublisherSource.Subscriberand hence it has two responsibilities:- Subscribe to the
Publisheron which this operator is applied. - Accept a
PublisherSource.Subscriberthat subscribes to this operator.
Functionthat takes aPublisherSource.Subscriberand returns aPublisherSource.Subscriber. ThePublisherSource.Subscriberthat is passed to thisFunctionis the one that has subscribed to this operator. 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(PublisherSource.Subscriber<? super R> subscriber)Implementation of this operator.
-
-
-
Method Detail
-
apply
PublisherSource.Subscriber<? super T> apply(PublisherSource.Subscriber<? super R> subscriber)
Implementation of this operator. SeePublisherOperatorfor definition of an operator.- Specified by:
applyin interfacejava.util.function.Function<T,R>- Parameters:
subscriber-PublisherSource.Subscriberthat subscribed to this operator.- Returns:
PublisherSource.Subscriberthat is used to subscribe to thePublisherthat this operator is applied to.
-
-