October 2018
Intermediate to advanced
556 pages
15h 18m
English
Along with the transformation of RxJava, the rest of the reactive libraries and frameworks vendors have also started adopting the Reactive Streams specification. Following the specification, Vert.x included an additional module which provides support for the Reactive Streams API. The following example demonstrates this addition:
... // (1).requestHandler(request -> { // ReactiveReadStream<Buffer> rrs = // (2) ReactiveReadStream.readStream(); // HttpServerResponse response = request.response(); // Flowable<Buffer> logs = Flowable // (3) .fromPublisher(logsService.stream()) // .map(Buffer::buffer) // .doOnTerminate(response::end); // logs.subscribe(rrs); // (4) response.setStatusCode(200); // (5) response.setChunked(true); ...Read now
Unlock full access