ExAtlas.Fly.Logs.StreamerSupervisor (ExAtlas v0.5.0)

Copy Markdown View Source

Supervises per-app Fly log Streamer processes.

Combines a Registry (unique keys by app_name) and a DynamicSupervisor (one Streamer per tracked app) under a :rest_for_one supervisor: if the registry dies, the DynamicSupervisor restarts with it (children are addressed via the registry, so a stale registry would be useless); but if a streamer burns the DynamicSupervisor's restart budget, the registry survives so other apps' cursors are not lost.

The DynamicSupervisor also gets a generous max_restarts so a single misbehaving streamer (bad token, network flap) does not tear down its peers.

Summary

Functions

Returns a specification to start this module under a supervisor.

Start a Streamer for app_name if one isn't already running.

Stop the Streamer for app_name, if any.

Pid of the Streamer for app_name, or nil.

Whether a Streamer is running for app_name.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(init_arg)

start_streamer(app_name, project_dir, opts \\ [])

Start a Streamer for app_name if one isn't already running.

stop_streamer(app_name)

Stop the Streamer for app_name, if any.

streamer_pid(app_name)

Pid of the Streamer for app_name, or nil.

streamer_running?(app_name)

Whether a Streamer is running for app_name.