-
Notifications
You must be signed in to change notification settings - Fork 79
Flow Controlling Content Producer
Mikko Karjalainen edited this page Apr 2, 2020
·
1 revision
The FSM regulates the packet flow as per reactive back pressure protocol. It receives content data packets from Netty channel pipeline, and emits them to the subscriber as requested. The specifics depend on the producer state.
All data packets go through a FIFO queue, from which they are dequeued as per reactive back pressure requests.
The FSM has four basic states:
- An initial state
- Waiting for subscribtion.
- The subscriber has not yet subscribed.
- The FSM queues all received data because it doesn’t have a subscriber to send to.
- Still waiting for subscription.
- The message body is fully received. Therefore no more content chunk events are expected.
- The full message body sits in the queue until a subscriber subscribes.
- Has an active subscription.
- The message body is still ongoing. It has not yet been fully received.
- The FSM keeps emitting content chunks from the FIFO, subject to reactive back pressure protocol.
- Has an active subscription.
- The message body is fully received. Therefore no more content chunk events are expected.
- There is still data in FIFO that has not yet been emitted due to back pressure constraints.