nodex v0.1.2 Nodex.Cnode
A module to help calling into and maintaining C-nodes.
Link to this section Summary
Functions
Call into the C-Node managed by Cnode referenced by pid or name. Returns the response or an error after a configurable timeout.
Returns a specification to start this module under a supervisor.
Returns the :"sname@host"
identifier for the C-Node.
With this you can leverage Node.monitor/2
or Kernel.send/2
for your own purposes.
Callback implementation for GenServer.init/1
.
Starts a GenServer that will start and monitor a C-Node.
Link to this section Types
init_args()
Specs
pid_or_name()
Specs
Link to this section Functions
call(pid_or_name, msg, timeout \\ 5000)
Specs
call(pid_or_name(), any(), integer()) :: {:ok, any()} | {:error, :timeout}
Call into the C-Node managed by Cnode referenced by pid or name. Returns the response or an error after a configurable timeout.
Parameters
pid_or_name
: The pid or name of the Cnode GenServermsg
: The message for the C-Nodetimeoout
: (optional, default: 5000) the time in milliseconds that is waited for a response.
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
cnode(pid_or_name)
Specs
cnode(pid_or_name()) :: node()
Returns the :"sname@host"
identifier for the C-Node.
With this you can leverage Node.monitor/2
or Kernel.send/2
for your own purposes.
Parameters
pid_or_name
: The pid or name of the Cnode GenServer
init(args)
Callback implementation for GenServer.init/1
.
spawn_cnode(state)
start_link(init_args, opts \\ [])
Starts a GenServer that will start and monitor a C-Node.
Parameters
init_args
: A map providing configuration on how to start a C-Node.:exec_path
required provide a path to the C-Node executable.:ready_line
a custom message that is awaited on the STDOUT of the C-Node.:spawn_inactive_timeout
set a timeout in milliseconds after the C-Node is considered unresponsive before receiving the ready_line.