Rector Context

Another key feature that comes with Reactor is Context. Context is an interface that is passed along the stream. The central idea of the Context interface is providing access to some contextual information that may be useful to access later at runtime phase. We may wonder why do we need such feature if we have ThreadLocal that allows doing the same things. For example, many frameworks uses ThreadLocal in order to pass SecurityContext along the users requests execution and making it possible to access the authorized user at any point of processing. Unfortunately, such concept works well only when we have a single-threaded processing, so the execution is attache to same Thread. If we start using that concept with the asynchronous ...

Get Hands-On Reactive Programming in Spring 5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.