Octoroom.Worker.Context (octoroom v0.1.0)

Copy Markdown View Source

What a worker knows when it starts: its room, its id, its input and output track names, its data outputs, and the room's participants at that moment. Call Octoroom.Room.state/1 for anything newer.

resumed is set when the worker starts while its room is recovering from a crash or restart: %{gone_ms: ms}, about how long the room was down. A worker that keeps state outside its process (a conversation so far) reloads it then.

saved is what this worker last returned in a save: action (see Octoroom.Worker), or nil: it's set after a crash or a change of args as well as on recovery.

Summary

Types

t()

@type t() :: %Octoroom.Worker.Context{
  data: [String.t()],
  id: String.t(),
  inputs: [String.t()],
  outputs: [String.t()],
  participants: [Octoroom.Participant.t()],
  resumed: nil | %{gone_ms: non_neg_integer()},
  room_id: String.t(),
  saved: term()
}