class

Obsctl::Server::ObsSupervisor

Inherits Reference < Object

Owns the single OBS WebSocket client and reconnect loop for the daemon.

Constants

DISCONNECT_FALLBACK_TIMEOUT = 100.milliseconds
STATS_POLL_INTERVAL = 2.seconds

Constructors

new(config : Config::Config, state : StateStore, event_broadcast : Proc(JSON::Any, Nil) | Nil = nil, log_broadcast : Proc(JSON::Any, Nil) | Nil = nil, logger : Runtime::Logger | Nil = nil, diagnostic_log_broadcast : Proc(JSON::Any, Bool) | Nil = nil, stats_poll_interval : Time::Span = STATS_POLL_INTERVAL)

Creates a supervisor that updates server state and optional event/log broadcasts.

Source

Instance methods

alive?

Returns true while the supervisor loop is starting or can still act.

Source
reconnect

Drops the active client so the supervisor reconnect loop starts over.

Source
start

Starts the reconnecting supervisor loop in a background fiber.

Source
stop

Stops reconnect attempts and closes the active OBS client.

Source
stopped_reconnect_attempted?

Test-only observability for reconnect attempts rejected by stopped lifecycle state.

Source
test_reconnect_before_publication

Test-only synchronization hook invoked after reconnect captures a live generation and before it re-checks that generation for public reconnect publication. The hook runs without supervisor locks held and may block to coordinate deterministic race specs.

Source
test_reconnect_before_publication=(test_reconnect_before_publication : Proc(Nil) | Nil)

Test-only synchronization hook invoked after reconnect captures a live generation and before it re-checks that generation for public reconnect publication. The hook runs without supervisor locks held and may block to coordinate deterministic race specs.

Source
with_client

Yields the active OBS client or raises when OBS is unavailable.

Source

Nested types