PhoenixReplay.Export.Job (PhoenixReplay v0.6.2)

Copy Markdown View Source

A video export: which recording, how far it got and where the video is.

status moves from :queued to :running, then to :done with the video at path, or to :failed with an error to show. A cancelled job is :cancelled, after :cancelling while a running one stops. progress is a percentage. node is the node that renders the video, whose disk it is on.

Summary

Functions

Whether the export can still be cancelled.

Whether name, a file or directory in the export directory, is one an export made: <id>.mp4 or the <id> directory of its screenshots, for an id new/2 made or one of PhoenixReplay.Export.Queue.Oban's, such as oban-42.

Whether the export has finished, either way.

A queued export of a recording, with the options it was asked for.

Types

id()

@type id() :: String.t()

status()

@type status() :: :queued | :running | :cancelling | :done | :failed | :cancelled

t()

@type t() :: %PhoenixReplay.Export.Job{
  error: String.t() | nil,
  finished_at: integer() | nil,
  id: id(),
  node: node() | nil,
  options: PhoenixReplay.Export.Options.t(),
  path: Path.t() | nil,
  progress: 0..100,
  recording_id: PhoenixReplay.Recording.id(),
  status: status()
}

Functions

cancellable?(job)

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

Whether the export can still be cancelled.

file?(name)

@spec file?(String.t()) :: boolean()

Whether name, a file or directory in the export directory, is one an export made: <id>.mp4 or the <id> directory of its screenshots, for an id new/2 made or one of PhoenixReplay.Export.Queue.Oban's, such as oban-42.

finished?(job)

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

Whether the export has finished, either way.

new(recording_id, options)

A queued export of a recording, with the options it was asked for.