Package io.servicetalk.concurrent.api
Interface ScanMapper<T,R>
- Type Parameters:
T- Type of items emitted by thePublisherthis 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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceResult 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 typeScanMapperwhich 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 typeScanMapperwhich will be emitted downstream asPublisherSource.Subscriber.onNext(Object), followed by a terminal signal.Invoked on eachPublisherSource.Subscriber.onNext(Object)signal and maps from typeScanMapperto typeScanMapper.
-
Method Details
-
mapOnNext
Invoked on eachPublisherSource.Subscriber.onNext(Object)signal and maps from typeScanMapperto 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 typeScanMapperwhich 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:
nullif no mapping is required andcauseis propagated toPublisherSource.Subscriber.onError(Throwable)- non-
nullwill 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 typeScanMapperwhich 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:
nullif no mapping is required andcauseis propagated toPublisherSource.Subscriber.onError(Throwable)- non-
nullwill 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).
-