View Source Unifex.CNode (Unifex v1.2.0)

Wraps Bundlex.CNode functionalities to support Unifex-specific CNode behaviours

Summary

Functions

Makes a synchronous call to CNode and waits for its reply.

Starts monitoring CNode from the calling process.

Works the same way as start_link/1, but does not link to CNode's associated server.

Works the same way as start_link/2, but does not link to CNode's associated server.

Spawns and connects to CNode cnode_name.

Spawns and connects to CNode cnode_name from application app.

Disconnects from CNode.

Types

@type on_start_t() :: {:ok, t()} | {:error, :spawn_cnode | :connect_to_cnode}
@type t() :: %Unifex.CNode{
  bundlex_cnode: Bundlex.CNode.t(),
  node: node(),
  server: pid()
}

Functions

Link to this function

call(c_node, fun_name, args \\ [], timeout \\ 5000)

View Source
@spec call(
  t(),
  fun_name :: atom(),
  args :: list(),
  timeout :: non_neg_integer() | :infinity
) ::
  response :: term()

Makes a synchronous call to CNode and waits for its reply.

If the response doesn't come in within timeout, error is raised. Messages are exchanged directly (without interacting with CNode's associated server).

@spec monitor(t()) :: reference()

Starts monitoring CNode from the calling process.

Link to this macro

start(native_name)

View Source (macro)

Works the same way as start_link/1, but does not link to CNode's associated server.

@spec start(app :: Application.app(), Unifex.Specs.native_name_t()) :: on_start_t()

Works the same way as start_link/2, but does not link to CNode's associated server.

Link to this macro

start_link(native_name)

View Source (macro)

Spawns and connects to CNode cnode_name.

For details, see Bundlex.CNode.start_link/2.

Link to this function

start_link(app, native_name)

View Source
@spec start_link(app :: Application.app(), Unifex.Specs.native_name_t()) ::
  on_start_t()

Spawns and connects to CNode cnode_name from application app.

For details, see Bundlex.CNode.start_link/2.

@spec stop(t()) :: :ok | {:error, :disconnect_cnode}

Disconnects from CNode.