Object
SynchronousPublisher<R>
TransformProcessor<T,R>
- Type Parameters:
T
- input typeR
- output type
- All Implemented Interfaces:
AutoCloseable
,Flow.Processor<T,
,R> Flow.Publisher<R>
,Flow.Subscriber<T>
Flow.Processor
which can be used to transform publisher messages into different type.
Example of transforming integer to String:
1 -> Publisher -> Transformer (changes to "1") -> Subscriber
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
onSubscribe
(Flow.Subscription subscription) Methods inherited from class SynchronousPublisher
close, closeExceptionally, submit, subscribe
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface Flow.Publisher
subscribe
-
Constructor Details
-
TransformProcessor
- Parameters:
transformer
- Transforms input message and publishes it to subscribers. If transformer returns empty message it will be ignored.
-
-
Method Details
-
onSubscribe
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<T>
-
onNext
- Specified by:
onNext
in interfaceFlow.Subscriber<T>
-
onError
- Specified by:
onError
in interfaceFlow.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceFlow.Subscriber<T>
-