ExAirtable.Supervisor (ExAirtable v0.1.0) View Source

This is the "master control" that takes care of rate-limiting and caching for all of your Tables.

See the ExAirtable module and start_link/2 for details about initialization.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Given a list of table module names, where each module has 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

start_link(table_modules, opts \\ [])

View Source

Given a list of table module names, where each module has implemented the ExAirtable.Table behaviour...

  1. Start a global RateLimiter
  2. For each unique Airtable base ID (from the passed table module configuration), start a BaseQueue
  3. For each passed table module, start a TableCache, which will in turn start a TableSynchronizer

Given options will be passed to sub-processes. Valid options are:

  • :delete_on_refresh (boolean) - By default, this is true, so that if a record is deleted in Airtable, it will be deleted in your cache. If you don't need this behaviour, setting it to false will reduce churn on your ETS cache (because the cache won't be cleared out on each refresh).
  • :sync_rate (integer) - amount of time in milliseconds between attempts to refresh table data from the API. Each table that you define will re-synchronize at this rate.