class
Obsctl::Server::ObsSupervisor
- Obsctl::Server::ObsSupervisor
- Reference
- Object
Overview
Owns the single OBS WebSocket client and reconnect loop for the daemon.
Defined in:
obsctl/server/obs_supervisor.crConstant Summary
-
DISCONNECT_FALLBACK_TIMEOUT =
100.milliseconds
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)
Creates a supervisor that updates server state and optional event/log broadcasts.
Instance Method Summary
-
#alive? : Bool
Returns true while the supervisor loop is starting or can still act.
-
#reconnect : Bool
Drops the active client so the supervisor reconnect loop starts over.
-
#start : Nil
Starts the reconnecting supervisor loop in a background fiber.
-
#stop : Nil
Stops reconnect attempts and closes the active OBS client.
-
#stopped_reconnect_attempted? : Bool
Test-only observability for reconnect attempts rejected by stopped lifecycle state.
-
#test_reconnect_before_publication : Proc(Nil) | Nil
Test-only synchronization hook invoked after
#reconnectcaptures a live generation and before it re-checks that generation for public reconnect publication. -
#test_reconnect_before_publication=(test_reconnect_before_publication : Proc(Nil) | Nil)
Test-only synchronization hook invoked after
#reconnectcaptures a live generation and before it re-checks that generation for public reconnect publication. -
#with_client(&block : OBS::Client -> T) : T forall T
Yields the active OBS client or raises when OBS is unavailable.
Constructor Detail
Creates a supervisor that updates server state and optional event/log broadcasts.
Instance Method Detail
Test-only observability for reconnect attempts rejected by stopped lifecycle state.
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.
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.
Yields the active OBS client or raises when OBS is unavailable.