Summary

Functions

Returns a specification to start this module under a supervisor.

Closes the worker.

Tells whether the given Worker is closed on the local node.

Dump internal stat for Worker.

Worker identifier.

Callback implementation for GenServer.init/1.

Updates the worker settings in runtime. Just a subset of the worker settings can be updated. https://mediasoup.org/documentation/v3/mediasoup/api/#worker-updateSettings

Types

@type create_option() ::
  %{
    optional(:logLevel) => log_level(),
    optional(:logTags) => [log_tag()],
    optional(:rtcMinPort) => integer(),
    optional(:rtcMaxPort) => integer(),
    optional(:dtlsCertificateFile) => String.t(),
    optional(:dtlsPrivateKeyFile) => String.t()
  }
  | Mediasoup.Worker.Settings.t()
@type event_type() :: :on_close | :on_dead
@type log_level() :: :debug | :warn | :error | :none
@type log_tag() ::
  :info
  | :ice
  | :dtls
  | :rtp
  | :srtp
  | :rtcp
  | :rtx
  | :bwe
  | :score
  | :simulcast
  | :svc
  | :sctp
  | :message
@type t() :: pid()
@type update_option() ::
  %{optional(:logLevel) => log_level(), optional(:logTags) => [log_tag()]}
  | Mediasoup.Worker.UpdateableSettings.t()

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Closes the worker.

@spec closed?(t()) :: boolean()

Tells whether the given Worker is closed on the local node.

Link to this function

create_router(pid, option)

View Source
@spec create_router(t(), Mediasoup.Router.create_option()) ::
  {:ok, Mediasoup.Router.t()} | {:error}

Creates a new router. https://mediasoup.org/documentation/v3/mediasoup/api/#worker-createRouter

Link to this function

create_webrtc_server(pid, option)

View Source

Creates a new WebRTC server. https://mediasoup.org/documentation/v3/mediasoup/api/#worker-createWebRtcServer

@spec dump(t()) :: map()

Dump internal stat for Worker.

Link to this function

event(pid, listener, event_types \\ [:on_close, :on_dead])

View Source
@spec event(t(), pid(), event_types :: [event_type()]) ::
  {:ok} | {:error, :terminated}

Starts observing event.

Worker identifier.

Callback implementation for GenServer.init/1.

@spec start_link([start_link_opt()]) :: :ignore | {:error, any()} | {:ok, pid()}
Link to this function

update_settings(pid, settings)

View Source
@spec update_settings(t(), update_option()) :: {:ok} | {:error}

Updates the worker settings in runtime. Just a subset of the worker settings can be updated. https://mediasoup.org/documentation/v3/mediasoup/api/#worker-updateSettings

@spec worker_count() :: non_neg_integer()