Package io.smallrye.mutiny.vertx.impl
Class WriteStreamSubscriberImpl<I,O>
- java.lang.Object
-
- io.smallrye.mutiny.vertx.impl.WriteStreamSubscriberImpl<I,O>
-
- All Implemented Interfaces:
WriteStreamSubscriber<I>,Flow.Subscriber<I>
public class WriteStreamSubscriberImpl<I,O> extends Object implements WriteStreamSubscriber<I>
-
-
Constructor Summary
Constructors Constructor Description WriteStreamSubscriberImpl(io.vertx.core.streams.WriteStream<O> stream, Function<I,O> mapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonComplete()WriteStreamSubscriber<I>onComplete(Runnable handler)Sets the handler to invoke on completion events.voidonError(Throwable failure)WriteStreamSubscriber<I>onFailure(Consumer<? super Throwable> handler)Sets the handler to invoke on failure events.voidonNext(I item)voidonSubscribe(Flow.Subscription subscription)WriteStreamSubscriber<I>onWriteStreamError(Consumer<? super Throwable> handler)Sets the handler to invoke if the adaptedWriteStreamfails.
-
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Flow.Subscription subscription)
- Specified by:
onSubscribein interfaceFlow.Subscriber<I>
-
onNext
public void onNext(I item)
- Specified by:
onNextin interfaceFlow.Subscriber<I>
-
onError
public void onError(Throwable failure)
- Specified by:
onErrorin interfaceFlow.Subscriber<I>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceFlow.Subscriber<I>
-
onFailure
public WriteStreamSubscriber<I> onFailure(Consumer<? super Throwable> handler)
Description copied from interface:WriteStreamSubscriberSets the handler to invoke on failure events.The underlying
WriteStream.end()method is not invoked in this case.- Specified by:
onFailurein interfaceWriteStreamSubscriber<I>- Parameters:
handler- the callback invoked with the failure- Returns:
- a reference to this, so the API can be used fluently
-
onComplete
public WriteStreamSubscriber<I> onComplete(Runnable handler)
Description copied from interface:WriteStreamSubscriberSets the handler to invoke on completion events.The underlying
WriteStream.end()method is invoked before the givencallback.- Specified by:
onCompletein interfaceWriteStreamSubscriber<I>- Parameters:
handler- the callback invoked when the completion event is received- Returns:
- a reference to this, so the API can be used fluently
-
onWriteStreamError
public WriteStreamSubscriber<I> onWriteStreamError(Consumer<? super Throwable> handler)
Description copied from interface:WriteStreamSubscriberSets the handler to invoke if the adaptedWriteStreamfails.The underlying
WriteStream.end()method is not invoked in this case.- Specified by:
onWriteStreamErrorin interfaceWriteStreamSubscriber<I>- Parameters:
handler- the callback invoked with the failure- Returns:
- a reference to this, so the API can be used fluently
-
-