Finds, or starts, the one machine of a conversation. The machine is unique in the whole
cluster: its name is registered in Horde.Registry, so a request that lands on any node reaches
the same process (a pid on another node works with Machine.submit/3 and the rest of the API).
Supervision
config :super_pi, machine_supervision:
:horde(default).Horde.DynamicSupervisorplaces the machine on a node and restarts it on another node when its node stops. The machine starts in:recovering, finds the task that was running, and resumes it.:local. The machine runs under the supervisor of the calling node and stays there. If the node stops, the name is released and the next request starts the machine on whichever node receives it (no automatic resume). Use it when a conversation must stay with the node that holds itslocalorscratchworkspace.
restart: :transient (default) restarts a machine that stops abnormally. restart: :temporary
never restarts it; use that for short-lived helpers such as subagent children.
A netsplit can briefly allow two machines for one conversation. Horde removes one when the nodes reconnect. Task rows carry the owner node, so the survivor does not reset a live task.
Summary
Functions
All conversation ids that have a machine, with their pids (the whole cluster).
Waits until the conversation has no registered machine. Returns :ok or :timeout.
Returns {:ok, pid} for the conversation's machine, starting it if there is none.
machine_opts are the options of Machine.start_link/1 (:extensions, test hooks).
Options: :restart (default :transient), :supervision (default from config).
The pid of the conversation's machine, started with extensions when none runs. With
set_extensions: true a running machine gets extensions too: the gateway resolves the harness
on every request. The RPC server keeps a running machine's extensions.
The machine pid for the conversation, on any node, or nil.
Functions
All conversation ids that have a machine, with their pids (the whole cluster).
Waits until the conversation has no registered machine. Returns :ok or :timeout.
Returns {:ok, pid} for the conversation's machine, starting it if there is none.
machine_opts are the options of Machine.start_link/1 (:extensions, test hooks).
Options: :restart (default :transient), :supervision (default from config).
The pid of the conversation's machine, started with extensions when none runs. With
set_extensions: true a running machine gets extensions too: the gateway resolves the harness
on every request. The RPC server keeps a running machine's extensions.
The machine pid for the conversation, on any node, or nil.