ObserverWeb.Apps.Port (Observer Web v0.2.4)

View Source

Retrieve Port information

Summary

Functions

Return port information

Types

t()

@type t() :: %{
  name: charlist() | String.t(),
  id: non_neg_integer(),
  connected: pid(),
  os_pid: non_neg_integer() | :undefined,
  memory: non_neg_integer()
}

Functions

info(node \\ Node.self(), port)

@spec info(node :: atom(), port :: port()) :: :undefined | t()

Return port information

Examples

iex> alias ObserverWeb.Observer.Port ...> [h | ] = :erlang.ports() ...> assert %{connected: , id: , name: , ospid: , memory: _} = Port.info(h) ...> assert :undefined = Port.info(nil) ...> assert :undefined = Port.info("")