See: Description
| Interface | Description |
|---|---|
| ReactiveReadStream<T> |
A Vert.x read stream that also implements reactive streams subscriber interface.
|
| ReactiveWriteStream<T> |
A Vert.x write stream that also implements reactive streams publisher interface.
|
ReactiveReadStream
which also implements a reactive streams `Subscriber`.
You can pass an instance of this to any reactive streams `Publisher` (e.g. a Publisher from Akka) and then you will be
able to read from that just like any other Vert.x `ReadStream` (e.g. use a `Pump` to pump it to a `WriteStream`.
Here's an example of taking a publisher from some other reactive streams implementation (e.g. Akka) and pumping that
stream to the body of a server side HTTP response. This will handle back pressure automatically.
[source,java]
----
examples.ReactiveStreamsExamples#example1
----
== Reactive Write Stream
We also provide an implementation of the Vert.x `WriteStream` interface with ReactiveWriteStream
which also implements a reactive streams `Publisher`. You can take any reactive streams `Subscriber`
(e.g. a Subscriber from Akka) and then you will be able* to write to it like any other Vert.x `WriteStream`.
(e.g. use a `Pump` to pump it from a `ReadStream`).
You use `pause`, `resume`, and `writeQueueFull`, as you would with any Vert.x read stream to handle your back pressure.
This is automatically translated internally into the reactive streams method of propagating back pressure
(requesting more items).
Here's an example of taking a subscriber from some other reactive streams implementation and pumping the body of
a server side HTTP request to that subscriber. This will handle back pressure automatically.
[source,java]
----
examples.ReactiveStreamsExamples#example2
----Copyright © 2023 Eclipse. All rights reserved.