GSS. Client. Limiter
(elixir_google_spreadsheets v1.0.1)
Copy Markdown
Model of Limiter request subscribed to Client with partition :write or :read
This process is a ProducerConsumer for this GenStage pipeline.
Summary
Types
@type state() :: %GSS.Client.Limiter{ interval: timeout(), max_demand: pos_integer(), max_interval: timeout(), producer: GenStage.from(), scheduled_at: integer() | nil, taken_events: pos_integer() }
Functions
Check to reach limit.
If limit not reached ask again after :interval timeout,
otherwise ask after :max_interval timeout.
@spec start_link(options()) :: GenServer.on_start()
Starts an limiter manager linked to the current process.
If the event manager is successfully created and initialized, the function returns {:ok, pid}, where pid is the PID of the server. If a process with the specified server name already exists, the function returns {:error, {:already_started, pid}} with the PID of that process.
Options
:name- used for name registration as described in the "Name registration" section of the module documentation:interval- ask new events from producer after:intervalmilliseconds.:max_demand- count of maximum requests per:maximum_interval:max_interval- maximum time that allowed in:max_demandrequests:clients- list of clients with partition options. For example[{GSS.Client, partition: :read}}].