Skip to content

Commit

Permalink
Separate type definitions and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed Aug 5, 2024
1 parent 1d9b606 commit 1672ec4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/throttle/amoc_throttle.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@

-type name() :: atom().
%% Atom representing the name of the throttle.

-type rate() :: infinity | non_neg_integer().
%% Number of events per given `t:interval/0', or infinity for effectively unlocking all throttling.
%% Note that a rate of zero means effectively pausing the throttle.

-type interarrival() :: infinity | non_neg_integer().
%% Time in milliseconds between two events, or infinity for effectively pausing the throttle. Note
%% that an interarrival of zero means effectively unlocking all throttling.

-type interval() :: non_neg_integer().
%% In milliseconds, defaults to 60000 (one minute).

-type throttle() :: #{rate := rate(), interval := interval()} |
#{interarrival := interarrival()}.
%% Throttle unit of measurement

-type config() :: #{rate := rate(),
interval => interval(),
parallelism => non_neg_integer()}
Expand Down

0 comments on commit 1672ec4

Please sign in to comment.