Open mrjerryjohns opened 2 years ago
This needs to be fixed for 1.0. This can actually completely prevent some reads (not even subscriptions) being serviced, leading them to time out.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Problem
The current logic in the
Engine
keeps an index into the active handler list and increments that index across the set of reportable handlers present and services them.This approach starts servicing handlers at arbitrary indices without accounting for the order in which handlers got dirty and became serviceable. This can result in highly jittered servicing times for subscriptions, especially if there are lots of subscribers OR if the time taken to service a subscriber is long (e.g subscriber is sleepy).
Solution
Insert into a queue handlers as they become reportable, and iterate through the queue to service them.