antikythera v0.4.0 Antikythera.TokenBucket View Source
A thin wrapper around Foretoken
to avoid collisions between bucket names by prefixing executor pool IDs.
For details, refer to Foretoken's documentation.
Link to this section Summary
Functions
Takes the specified tokens from the bucket.
Link to this section Functions
Link to this function
take(epool_id, bucket, milliseconds_per_token, max_tokens, tokens_to_take \\ 1)
View SourceSpecs
take( Antikythera.ExecutorPool.Id.t(), any(), pos_integer(), pos_integer(), pos_integer() ) :: :ok | {:error, pos_integer()}
Takes the specified tokens from the bucket.
Internally the actual bucket name is prefixed with the given epool_id
.
Note that return value on error is slightly different from that of Foretoken.take/5
(for backward compatibility).