PhoenixReplay.Export.Queue.Local (PhoenixReplay v0.6.2)

Copy Markdown View Source

The default PhoenixReplay.Export.Queue: keeps video exports in memory and runs them under PhoenixReplay.Export.TaskSupervisor, :max_concurrency at a time, on the node that asked for them. They are lost when the node stops; PhoenixReplay.Export.Queue.Oban keeps them.

It keeps every job until its video is :ttl old, broadcasts each change to a job on the recording's topic, and deletes expired videos. A job whose task crashes fails, and the next one starts. When it starts, and every quarter of :ttl from then on, it deletes the videos and screenshots in the export directory older than :ttl: those a server that stopped left, so they do not pile up across deploys, and those of exports another queue, such as PhoenixReplay.Export.Queue.Oban, rendered on this node. Other files there are left alone, so :dir may be shared.

Cancelling a queued job takes it out of the queue. A running one is sent {PhoenixReplay.Export, :cancel} rather than killed, so it closes its browser and stops ffmpeg itself, and ends with {:error, :cancelled}.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the export queue, registered under this module's name.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the export queue, registered under this module's name.