View Source Stdio.Op (stdio v0.4.4)

Run a sequence of system calls on a process

Summary

Types

Options to modify the behavior of an operation

t()

Operations consist of a list of tuples containing

Functions

Creates and configures a new process from the supervisor process.

Types

@type option() ::
  {:state, boolean()}
  | {:errexit, boolean()}
  | {:transform,
     (any() -> :ok | {:ok, state :: any()} | {:error, :prx.posix()})}

Options to modify the behavior of an operation:

  • state: pass ok result as the first parameter to the next operation (default: false)

  • errexit: abort operations on error (default: true)

  • transform: abort operations on error (default: true)

@type t() ::
  {atom(), list()}
  | {module(), atom(), list()}
  | {module(), atom(), list(), [option()]}

Operations consist of a list of tuples containing:

  • an optional module name (default: :prx)
  • a function name
  • a list of arguments
  • an optional list of options to modify the behaviour of the operation (see t:option)

Examples

{:setresuid, [1000,1000,1000]}
{:prx, :setresuid, [1000,1000,1000]}
{:prx, :setresuid, [1000,1000,1000], errexit: false}

Functions

Link to this function

task!(stdio, ops, initfun, onerrorfun)

View Source
@spec task!(
  Stdio.t(),
  ops :: [t() | [t()]],
  (init :: :prx.task() ->
     {:ok, pipeline :: Stdio.pipeline()} | {:error, :prx.posix()}),
  (sh :: :prx.task() -> any())
) :: Stdio.pipeline()

Creates and configures a new process from the supervisor process.