Juggernaut.Pool.Output (Juggernaut v0.4.0)

Copy Markdown View Source

An IO device that keeps only the end of what is written to it.

A worker sets it as the group leader of the process that starts its :peer: over a :standard_io connection the peer relays all its output (tests, the app, Logger) as IO requests to that group leader (docs/dependencies/peer.md), so none of it reaches the controller's stdout, which carries only Juggernaut's formats. The last limit bytes are kept for error messages (a failed boot shows what the peer printed). Reads answer :eof; getopts reports a unicode binary device, as the elixir application asks.

Summary

Functions

Returns a specification to start this module under a supervisor.

Forgets what was kept.

Starts a device linked to the caller, keeping the last limit bytes.

The kept end of the output.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear(device)

@spec clear(pid()) :: :ok

Forgets what was kept.

start_link(limit \\ 65536)

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

Starts a device linked to the caller, keeping the last limit bytes.

tail(device)

@spec tail(pid()) :: String.t()

The kept end of the output.