Skip to content

PID Controller #24

@RxDave

Description

@RxDave

Create a PID operator that automatically throttles notifications from the server based on the changing performance of the client.

For example, the operator could buffer notifications on the client while they're being processed. The goal is to keep the buffer at zero. As the length of the buffer increases, a closed-over observable pushes notifications to the server indicating the calculated throttle period that will help the client to consume items in its buffer faster than it receives them; e.g., as the buffer length increases, the throttle period is increased, which decreases the number of notifications arriving on the client, thus eventually decreasing the buffer size to zero. As it's decreasing, the throttle period may also be decreasing, as long as the buffer size continues to decrease.

For situations in which dropping notifications is unacceptable, yet batching notifications is at least more efficient than processing notifications individually, then instead of throttling the server can use batching (in this case, the client would push buffer count changes rather than throttle period changes).

And perhaps some combination of both could be used, for extreme cases where some upper limit is reached and the server must transition from batching to throttling.

https://en.wikipedia.org/wiki/PID_controller

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions