InfluxElixir.ConnectionSupervisor (InfluxElixir v0.1.15)

Copy Markdown View Source

Per-connection supervisor using :rest_for_one strategy.

Manages a Finch pool and BatchWriter GenServers for a single named InfluxDB connection with crash isolation.

On init, registers the connection config in InfluxElixir.Connection so it can be resolved by name from any process via Connection.fetch!/1 or the facade.

If a Finch pool crashes, all BatchWriters under that connection restart (they depend on the pool). A single BatchWriter crash does NOT take down the pool or sibling writers.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts a ConnectionSupervisor for a named connection.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(config)

@spec start_link(keyword()) :: Supervisor.on_start()

Starts a ConnectionSupervisor for a named connection.

Config

  • :name - connection name (atom, required)
  • :host - InfluxDB host URL
  • :token - authentication token
  • :database - default database for writes/queries
  • :databases - list of database names (see InfluxElixir.Config)
  • :pool_size - Finch connection pool size (default: 10)