The client side of mix juggernaut.server (design notes §12): finds the server of a
checkout from server/server.json and server/token, sends one request and relays the
frames that come back.
attach/3 is what mix juggernaut and mix juggernaut.check do when a server is
reachable: the job's stdout goes through the Mix shell, its stderr to stderr (or
ctx.progress), the queue position to stderr, and its exit code is returned. An
address file whose server no longer answers is treated as no server.
Summary
Functions
The address of root's server, or :none when no address file is readable.
Runs kind (run or check) with argv on the server of ctx.root: {:attached, code} with the job's exit code, or :none when no server answers.
Shows one reply frame of a job: its output, its queue position or a refusal.
Sends kind (run, check, status, stop) with fields to root's server and
calls on_frame with each reply frame until the last. Returns {:ok, last_frame},
:none when no server answers, or an infrastructure error when the connection drops.
Types
@type address() :: %{port: :inet.port_number(), token: String.t()}
Where a server listens.
Functions
The address of root's server, or :none when no address file is readable.
Runs kind (run or check) with argv on the server of ctx.root: {:attached, code} with the job's exit code, or :none when no server answers.
Shows one reply frame of a job: its output, its queue position or a refusal.
@spec request(Path.t(), String.t(), map(), (map() -> term())) :: {:ok, map()} | :none | {:error, Juggernaut.Error.t()}
Sends kind (run, check, status, stop) with fields to root's server and
calls on_frame with each reply frame until the last. Returns {:ok, last_frame},
:none when no server answers, or an infrastructure error when the connection drops.