ExAirtable.RateLimiter (ExAirtable v0.2.9) View Source

The RateLimiter ensures that no requests go to Airtable fast enough to trigger API rate-limiting.

Requests will be handled immediately until more than 5 happen, at which point they go onto a queue which flushes every second. This ensures that no more than 5 requests per second will ever be sent to Airtable.

There is one ExAirtable.RateLimiter.BaseQueue per base to track requests, since Airtable does rate-limiting per-base.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Add a request to the request buffer for a given table.

Pass a list of valid module names where the given modules have implemented the ExAirtable.Table behaviour.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

request(table_module, request)

View Source

Add a request to the request buffer for a given table.

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

Pass a list of valid module names where the given modules have implemented the ExAirtable.Table behaviour.

Internal state is a map of %BaseQueue{} structs where the key is the base ID.