Skip to Content
Hands-On Reactive Programming in Spring 5
book

Hands-On Reactive Programming in Spring 5

by Oleh Dokuka, Igor Lozynskyi
October 2018
Intermediate to advanced
556 pages
15h 18m
English
Packt Publishing
Content preview from Hands-On Reactive Programming in Spring 5

Transforming reactive sequences into blocking structures

The Project Reactor library provides an API for transforming reactive sequences into blocking structures. Even though any blocking operations should be omitted in a reactive application, sometimes it is required by the upper-level API. So, we have the following options for blocking the stream and producing a result synchronously:

  • The toIterable method transforms reactive Flux into a blocking Iterable.
  • The toStream method transforms reactive Flux into a blocking Stream API. As of Reactor 3.2, it uses the toIterable method under the hood.
  • The blockFirst method blocks the current thread until the upstream signals its first value or completes.
  • The blockLast method blocks the current thread ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Spring Microservices in Action, Second Edition

Spring Microservices in Action, Second Edition

John Carnell, Illary Huaylupo Sanchez

Publisher Resources

ISBN: 9781787284951Supplemental Content