Package io.servicetalk.concurrent.api
Interface ScanMapper<T,R>
- Type Parameters:
T
- Type of items emitted by thePublisher
this operator is applied.R
- Type of items emitted by this operator.
- All Known Subinterfaces:
ScanLifetimeMapper<T,
R>
public interface ScanMapper<T,R>
Provides the ability to transform (aka map) signals emitted via the
Publisher.scanWithMapper(Supplier)
operator.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Result of a mapping operation of a terminal signal. -
Method Summary
Modifier and TypeMethodDescriptionInvoked when aPublisherSource.Subscriber.onComplete()
signal is received and can map the current state into an object of typeScanMapper
which will be emitted downstream asPublisherSource.Subscriber.onNext(Object)
, followed by a terminal signal.mapOnError
(Throwable cause) Invoked when aPublisherSource.Subscriber.onError(Throwable)
signal is received and can map the current state into an object of typeScanMapper
which will be emitted downstream asPublisherSource.Subscriber.onNext(Object)
, followed by a terminal signal.Invoked on eachPublisherSource.Subscriber.onNext(Object)
signal and maps from typeScanMapper
to typeScanMapper
.
-
Method Details
-
mapOnNext
Invoked on eachPublisherSource.Subscriber.onNext(Object)
signal and maps from typeScanMapper
to typeScanMapper
.- Parameters:
next
- The next element emitted fromPublisherSource.Subscriber.onNext(Object)
.- Returns:
- The result of mapping
next
.
-
mapOnError
Invoked when aPublisherSource.Subscriber.onError(Throwable)
signal is received and can map the current state into an object of typeScanMapper
which will be emitted downstream asPublisherSource.Subscriber.onNext(Object)
, followed by a terminal signal.If this method throws the exception will be propagated downstream via
PublisherSource.Subscriber.onError(Throwable)
.- Parameters:
cause
- The cause from upstreamPublisherSource.Subscriber.onError(Throwable)
.- Returns:
null
if no mapping is required andcause
is propagated toPublisherSource.Subscriber.onError(Throwable)
- non-
null
will propagateScanMapper.MappedTerminal.onNext()
toPublisherSource.Subscriber.onNext(Object)
then will terminate withScanMapper.MappedTerminal.terminal()
- Throws:
Throwable
- If an exception occurs, which will be propagated downstream viaPublisherSource.Subscriber.onError(Throwable)
.
-
mapOnComplete
Invoked when aPublisherSource.Subscriber.onComplete()
signal is received and can map the current state into an object of typeScanMapper
which will be emitted downstream asPublisherSource.Subscriber.onNext(Object)
, followed by a terminal signal.If this method throws the exception will be propagated downstream via
PublisherSource.Subscriber.onError(Throwable)
.- Returns:
null
if no mapping is required andcause
is propagated toPublisherSource.Subscriber.onError(Throwable)
- non-
null
will propagateScanMapper.MappedTerminal.onNext()
toPublisherSource.Subscriber.onNext(Object)
then will terminate withScanMapper.MappedTerminal.terminal()
- Throws:
Throwable
- If an exception occurs, which will be propagated downstream viaPublisherSource.Subscriber.onError(Throwable)
.
-