ElixirScope.Capture.AsyncWriterPool (elixir_scope v0.0.1)

AsyncWriterPool manages a pool of AsyncWriter processes that consume events from ring buffers and process them asynchronously.

Key responsibilities:

  • Manage a configurable pool of AsyncWriter workers
  • Distribute work segments across workers to avoid duplication
  • Monitor and restart failed workers automatically
  • Provide scaling, metrics aggregation, and health monitoring
  • Coordinate workers to process events efficiently

Summary

Functions

Returns a specification to start this module under a supervisor.

Gets aggregated metrics from all workers.

Gets the current state of the pool.

Gets worker assignment information.

Performs a health check on all workers.

Scales the pool to the specified size.

Starts the AsyncWriterPool with the given configuration.

Gracefully stops the pool and all workers.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_metrics(pid)

Gets aggregated metrics from all workers.

get_state(pid)

Gets the current state of the pool.

get_worker_assignments(pid)

Gets worker assignment information.

health_check(pid)

Performs a health check on all workers.

scale_pool(pid, new_size)

Scales the pool to the specified size.

start_link(opts \\ [])

Starts the AsyncWriterPool with the given configuration.

start_mock()

stop(pid)

Gracefully stops the pool and all workers.