Class TimeoutStream
- java.lang.Object
-
- io.vertx.mutiny.core.TimeoutStream
-
- All Implemented Interfaces:
ReadStream<Long>
,StreamBase
public class TimeoutStream extends Object implements ReadStream<Long>
A timeout stream is triggered by a timer, theHandler
will be call when the timer is fired, it can be once or several times depending on the nature of the timer related to this stream. The will be called after the timer handler has been called.Pausing the timer inhibits the timer shots until the stream is resumed. Setting a null handler callback cancels the timer.
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<TimeoutStream>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description TimeoutStream(io.vertx.core.TimeoutStream delegate)
TimeoutStream(Object delegate)
-
Method Summary
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<TimeoutStream> __TYPE_ARG
-
-
Constructor Detail
-
TimeoutStream
public TimeoutStream(io.vertx.core.TimeoutStream delegate)
-
TimeoutStream
public TimeoutStream(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.core.TimeoutStream getDelegate()
- Specified by:
getDelegate
in interfaceReadStream<Long>
- Specified by:
getDelegate
in interfaceStreamBase
-
pipe
public Pipe<Long> pipe()
- Specified by:
pipe
in interfaceReadStream<Long>
- Returns:
- a pipe
-
pipeTo
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<Long> dst)
Pipe thisReadStream
to theWriteStream
.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the
handler
will be called with the result.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
pipeTo
in interfaceReadStream<Long>
- Parameters:
dst
- the destination write stream- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
pipeToAndAwait
public Void pipeToAndAwait(WriteStream<Long> dst)
Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
pipeToAndAwait
in interfaceReadStream<Long>
- Parameters:
dst
- the destination write stream- Returns:
- the Void instance produced by the operation.
-
pipeToAndForget
public void pipeToAndForget(WriteStream<Long> dst)
Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
that ignores the result of the operation.This method subscribes on the result of
ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
but you don't need to compose it with other operations.- Specified by:
pipeToAndForget
in interfaceReadStream<Long>
- Parameters:
dst
- the destination write stream
-
exceptionHandler
public TimeoutStream exceptionHandler(Consumer<Throwable> handler)
- Specified by:
exceptionHandler
in interfaceReadStream<Long>
- Specified by:
exceptionHandler
in interfaceStreamBase
- Parameters:
handler
- the exception handler- Returns:
-
handler
public TimeoutStream handler(Consumer<Long> handler)
- Specified by:
handler
in interfaceReadStream<Long>
- Returns:
-
pause
public TimeoutStream pause()
- Specified by:
pause
in interfaceReadStream<Long>
- Returns:
- a reference to this, so the API can be used fluently
-
resume
public TimeoutStream resume()
- Specified by:
resume
in interfaceReadStream<Long>
- Returns:
- a reference to this, so the API can be used fluently
-
fetch
public TimeoutStream fetch(long amount)
- Specified by:
fetch
in interfaceReadStream<Long>
- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
public TimeoutStream endHandler(Runnable endHandler)
- Specified by:
endHandler
in interfaceReadStream<Long>
- Returns:
-
cancel
public void cancel()
-
toMulti
@CheckReturnValue public io.smallrye.mutiny.Multi<Long> toMulti()
- Specified by:
toMulti
in interfaceReadStream<Long>
-
newInstance
public static TimeoutStream newInstance(io.vertx.core.TimeoutStream arg)
-
-