resgateio/resgate

Throttling reset requests

jirenius opened this issue · 1 comments

Issue

When Resgate receives a system.reset request, it will generate get and/or access requests for all matching resources.
If a lot of resources matches the pattern, the service(s) may be overwhelmed, failing to respond within Resgate's default timeout period of 3 seconds. This will in turn result in Resgate sending unsubscribe events to the clients for any timed out resource.

Solution

It should be possible to throttle the number of concurrent requests being sent on system.reset. This can be done by introducing a single integer configuration value:

  • resetThrottle - integer value telling how many concurrent requests to have running at the same time for any single system.reset event.

Resolved in PR #201