Skip to content

6. Rx, the Composable Stream

Coming soon

This chapter is an outline. The full draft ships in a follow-up PR.

What this chapter will cover

Rx is Uni's abstraction for anything that happens over time: asynchronous results, event streams, websockets, server-sent events, timers. It is a single type with a small set of operators, and it is the backbone of async code across the library.

Concepts introduced:

  • Rx[A] as a description of "something that will produce zero or more A values".
  • The four shapes: single, stream, completable, never, and when each is the right pick.
  • The operator set: map, flatMap, filter, take, zip, merge, recover.
  • How Rx composes with Design lifecycle: closing a session cancels the streams it owns.
  • Backpressure, cancellation, and the common mistakes (subscribe without a handle, unbounded buffering).

Reference you can read now

← 5. JSON & MessagePack | Next → 7. Retry, Circuit Breakers, Resources

Released under the Apache 2.0 License.