Resilient
|
Interface to specify the algorithm the Ratelimiter
should use.
More...
#include <ratelimiter.hpp>
Public Types | |
using | permit_type = Permit |
The type of the permit returned by acquire. | |
using | error_type = Error |
The type of the error returned by acquire. | |
Public Member Functions | |
virtual Variant< permit_type, error_type > | acquire ()=0 |
Acquire a single permit to execute a request. More... | |
virtual void | release (permit_type)=0 |
Release a permit that was previously acquired. More... | |
Interface to specify the algorithm the Ratelimiter
should use.
Permit | The type of permits the strategy returns. |
Error | The kind of error returned when acquire fails. |
|
pure virtual |
Acquire a single permit to execute a request.
acquire()
is called before invoking the function to wait for a permit. This call may block.
release()
is called with the permit. Implemented in resilient::BlockingFixedConcurrentExecutionsStrategy.
|
pure virtual |
Release a permit that was previously acquired.
release()
is called after the invoked function returned or throwed.
permit_type | The permit returned by acquire() . |
Implemented in resilient::BlockingFixedConcurrentExecutionsStrategy.