Runlet.Process (runlet v1.2.7)

View Source

Process job control

Summary

Functions

Add a command to a user's process table.

Tests if a PID is running.

Retrieve a formatted process table for a user.

Restart saved processes.

Delete a command from a user's process table.

Toggle formatting of events.

Terminate a process for a user.

Sets the number of events allowed in a period of time (minutes). Events exceeding this limit are dropped.

Find a running command by PID.

Force a process to exit.

Run saved processes for a user.

Return the list of running commands.

Starts a stopped process.

Restarts running processes.

Suppresses output for a process for the given number of minutes.

List available process tables.

List process entries for a user.

Types

t()

@type t() :: {pid(), binary()}

Functions

add(user, pid, cmd)

@spec add(binary(), pid() | Runlet.PID.t(), binary()) :: :ok | {:error, any()}

Add a command to a user's process table.

alive?(pid)

@spec alive?(pid()) :: boolean()

Tests if a PID is running.

all(name)

@spec all(binary()) :: [binary()]

Retrieve a formatted process table for a user.

boot(stdout)

@spec boot(fun()) :: [any()]

Restart saved processes.

delete(name, id)

@spec delete(binary(), pid() | Runlet.PID.t()) :: :ok | {:error, any()}

Delete a command from a user's process table.

format(name, id)

@spec format(binary(), Runlet.PID.t()) :: binary()

Toggle formatting of events.

kill(name, id)

@spec kill(binary(), Runlet.PID.t()) :: binary()

Terminate a process for a user.

limit(name, id, count \\ 1, minutes \\ 1)

@spec limit(binary(), Runlet.PID.t(), pos_integer(), pos_integer()) :: binary()

Sets the number of events allowed in a period of time (minutes). Events exceeding this limit are dropped.

lookup(name, id)

@spec lookup(binary(), Runlet.PID.t()) :: [t()]

Find a running command by PID.

match(name, id, fun)

@spec match(binary(), Runlet.PID.t(), (pid(), binary() -> binary())) :: binary()

pexit(name, id)

@spec pexit(binary(), Runlet.PID.t()) :: binary()

Force a process to exit.

run(name, proc, stdout)

@spec run(binary(), [t()], fun()) :: [any()]

Run saved processes for a user.

running(name)

@spec running(binary()) :: [binary()]

Return the list of running commands.

start(name, id)

@spec start(binary(), Runlet.PID.t()) :: binary()

Starts a stopped process.

start_link(stdout)

Restarts running processes.

stop(name, id, minutes \\ 60)

@spec stop(binary(), Runlet.PID.t(), non_neg_integer()) :: binary()

Suppresses output for a process for the given number of minutes.

table()

@spec table() :: [binary()]

List available process tables.

table(name)

@spec table(binary()) :: [t()]

List process entries for a user.