Regulator v0.1.0 Regulator View Source
Adaptive concurrency limits.
Link to this section Summary
Functions
Ask for access to a protected service. If we've reached the concurrency limit
then ask
will return a :dropped
atom without executing the callback. Otherwise
the callback will be applied. The callback must return tuple with the result
as the first element and the desired return value as the second. The available
result atoms are
Creates a new regulator.
Link to this section Functions
Ask for access to a protected service. If we've reached the concurrency limit
then ask
will return a :dropped
atom without executing the callback. Otherwise
the callback will be applied. The callback must return tuple with the result
as the first element and the desired return value as the second. The available
result atoms are:
:ok
- The call succeeded.:drop
- The call failed or timed out. This is used as a signal to backoff or otherwise adjust the limit.:ignore
- The call should not be counted in the concurrency limit. This is typically used to filter out status checks and other low latency RPCs.
Creates a new regulator.