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 ...
Rector Context
Get Hands-On Reactive Programming in Spring 5 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.