ExAirtable.BaseQueue (ExAirtable v0.1.0) View Source

The purpose of the BaseQueue is to serve as a GenStage "Producer" for the RateLimiter.

Requests that are meant to go to Airtable are sent to the appropriate BaseQueue (one per base, shared among all Tables), and put in line for the RateLimiter to execute as it's able.

Note that the request buffer is a MapSet - meaning that duplicate requests will be ignored.

Link to this section Summary

Types

t()

Each BaseQueue stores a list of tables and all pending requests against that base, as well as the GenServer ID of the BaseQueue.

Functions

Callback implementation for GenStage.handle_cast/2.

Retrieve the BaseQueue (GenServer) ID for a given table.

Callback implementation for GenStage.init/1.

Add a request to the request buffer.

Link to this section Types

Specs

t() :: %ExAirtable.BaseQueue{
  requests: MapSet.t(ExAirtable.RateLimiter.Request.t()),
  tables: [module()]
}

Each BaseQueue stores a list of tables and all pending requests against that base, as well as the GenServer ID of the BaseQueue.

Link to this section Functions

Callback implementation for GenStage.handle_cast/2.

Link to this function

handle_demand(demand, state)

View Source

Callback implementation for GenStage.handle_demand/2.

Retrieve the BaseQueue (GenServer) ID for a given table.

Callback implementation for GenStage.init/1.

Add a request to the request buffer.

Note that the request buffer is a MapSet - meaning that (exact) duplicate requests will be ignored.

Link to this function

start_link(table_modules)

View Source