dist_nifs.h
Include dependency graph for dist_nifs.h:
This graph shows which files directly or indirectly include dist_nifs.h:
Declaration of distribution NIFs and resources.
Defines
-
DIST_OTP_RELEASE "27"
Functions
-
term dist_send_message(term target, term payload, Context *ctx)
@doc Enqueue a message to be sent to a remote process. This function may raise a badarg error following OTP if target is incorrect.
- Parameters:
target – external pid or a tuple {atom(), node()} to refer to a remote registered process
payload – message to send
ctx – process that sends the message.
- Returns:
the payload if the message was sent or term_invalid if there was a badarg error
-
term dist_monitor(struct DistConnection *conn_obj, term from_pid, term target_proc, term monitor_ref, Context *ctx)
@doc Setup a monitor on a local process for a distributed process. @end
- Parameters:
conn_obj – object of the connection
from_pid – remote pid setting up the monitor
target_proc – atom (for registered process) or pid of the local process to monitor
monitor_ref – reference used for monitor
ctx – context for memory allocation
-
void dist_spawn_reply(term req_id, term to_pid, bool link, bool monitor, term result, struct DistConnection *connection, GlobalContext *global)
@doc Send a spawn reply signal to a node @end
- Parameters:
conn_obj – object of the connection
req_id – reference identifying the request
to_pid – (remote) process id identifying the caller
link – if a link was created
monitor – if a monitor was created
result – pid of the spawned process or atom for an error
ctx – context for memory allocation
-
void dist_send_payload_exit(struct LinkRemoteMonitor *monitor, term reason, Context *ctx)
@doc Send a link exit signal (PAYLOAD_EXIT)
- Parameters:
monitor – structure with node, process_id, serial and creation
reason – reason to send as the payload
ctx – process that is exiting.
-
term dist_send_link(term from_pid, term to_pid, Context *ctx)
@doc Send a link signal (LINK)
- Parameters:
from_pid – the pid linking to
to_pid – the (remote) pid to link to
ctx – context for memory allocation
- Returns:
true if the link message was sent or queued, or term_invalid if an error occurred (e.g. noproc or oom)
-
void dist_send_unlink_id(uint64_t unlink_id, term from_pid, term to_pid, Context *ctx)
@doc Send an unlink id signal (UNLINK_ID), silently do nothing if node is not connected
- Parameters:
unlink_id – unique id of the unlink operation
from_pid – the pid linking to
to_pid – the (remote) pid to link to
ctx – context for memory allocation
-
void dist_send_unlink_id_ack(uint64_t unlink_id, term from_pid, term to_pid, Context *ctx)
@doc Send an unlink id ack signal (UNLINK_ID_ACK), silently do nothing if node is not connected
- Parameters:
unlink_id – unique id of the unlink operation
from_pid – the pid linking to
to_pid – the (remote) pid to link to
ctx – context for memory allocation
Variables
-
const ErlNifResourceTypeInit dist_connection_resource_type_init
-
const struct Nif setnode_3_nif
-
const struct Nif dist_ctrl_get_data_notification_nif
-
const struct Nif dist_ctrl_get_data_nif
-
const struct Nif dist_ctrl_put_data_nif