public interface ReadStream<T> extends StreamBase
Any class that implements this interface can be used by a Pipe
to pipe data from it
to a WriteStream
.
handler
.handler
.pause()
, resume()
and fetch(long)
methods:
resume()
sets the flowing modepause()
sets the fetch mode and resets the demand to 0
fetch(long)
requests a specific amount of elements and adds it to the actual demandoriginal
non RX-ified interface using Vert.x codegen.Modifier and Type | Method and Description |
---|---|
ReadStream<T> |
endHandler(Handler<Void> endHandler)
Set an end handler.
|
ReadStream<T> |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the read stream.
|
ReadStream<T> |
fetch(long amount)
Fetch the specified
amount of elements. |
ReadStream |
getDelegate() |
ReadStream<T> |
handler(Handler<T> handler)
Set a data handler.
|
static <T> ReadStream<T> |
newInstance(ReadStream arg) |
static <T> ReadStream<T> |
newInstance(ReadStream arg,
io.vertx.lang.rx.TypeArg<T> __typeArg_T) |
ReadStream<T> |
pause()
Pause the
ReadStream , it sets the buffer in fetch mode and clears the actual demand. |
Pipe<T> |
pipe()
Pause this stream and return a
Pipe to transfer the elements of this stream to a destination WriteStream . |
Completable |
pipeTo(WriteStream<T> dst)
Pipe this
ReadStream to the WriteStream . |
ReadStream<T> |
resume()
Resume reading, and sets the buffer in
flowing mode. |
Completable |
rxPipeTo(WriteStream<T> dst)
Pipe this
ReadStream to the WriteStream . |
Flowable<T> |
toFlowable() |
Observable<T> |
toObservable() |
newInstance
ReadStream getDelegate()
getDelegate
in interface StreamBase
ReadStream<T> exceptionHandler(Handler<Throwable> handler)
exceptionHandler
in interface StreamBase
handler
- the exception handlerReadStream<T> handler(Handler<T> handler)
handler
- ReadStream<T> pause()
ReadStream
, it sets the buffer in fetch
mode and clears the actual demand.
While it's paused, no data will be sent to the data handler
.
ReadStream<T> resume()
flowing
mode.
If the ReadStream
has been paused, reading will recommence on it.ReadStream<T> fetch(long amount)
amount
of elements. If the ReadStream
has been paused, reading will
recommence with the specified amount
of items, otherwise the specified amount
will
be added to the current stream demand.amount
- ReadStream<T> endHandler(Handler<Void> endHandler)
endHandler
- Pipe<T> pipe()
Pipe
to transfer the elements of this stream to a destination WriteStream
.
The stream will be resumed when the pipe will be wired to a WriteStream
.Completable pipeTo(WriteStream<T> dst)
ReadStream
to the WriteStream
.
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.
dst
- the destination write streamCompletable rxPipeTo(WriteStream<T> dst)
ReadStream
to the WriteStream
.
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.
dst
- the destination write streamObservable<T> toObservable()
static <T> ReadStream<T> newInstance(ReadStream arg)
static <T> ReadStream<T> newInstance(ReadStream arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T)
Copyright © 2023 Eclipse. All rights reserved.