The channel model is RSocket’s bidirectional communication pattern: the client and server keep an open channel, stream multiple messages, and can send data at any time. section 14.1 section 14.2.4
A channel handler uses reactive streams on both sides:
- The handler accepts a Flux of incoming requests from the client. section 14.2.4
- The handler returns a Flux of responses that can stream back to the client. section 14.2.4
- This two-way Flux arrangement distinguishes channels from request-stream communication, where the client sends only one request. section 14.2.4
Streaming gratuity calculations
A Spring controller can accept a Flux of GratuityIn values, calculate each bill’s gratuity, and return a Flux of GratuityOut values. A client sends several bills over an open channel and receives each calculated result as it becomes available. section 14.2.4
