VoiceEngine.BridgeSupervisor (voice_engine v0.1.0)

Copy Markdown View Source

DynamicSupervisor for VoiceEngine.Bridge processes.

Host apps call ensure_bridge/1 to start a bridge for a session, passing all required opts (session_id, config, turn_fn, endpoint, pubsub).

Summary

Functions

Returns a specification to start this module under a supervisor.

Ensures a Bridge exists for the given session. Returns {:ok, pid}.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

ensure_bridge(opts)

Ensures a Bridge exists for the given session. Returns {:ok, pid}.

Required opts:

  • :session_id
  • :configVoiceEngine.Config struct
  • :turn_fnfn text -> {:ok, response} | {:error, reason} end

  • :endpoint — Phoenix Endpoint module
  • :pubsub — PubSub module

start_link(init_arg)