Skip to content

Module dev_node_process.erl

A device that implements the singleton pattern for processes specific to an individual node.

Description

This device uses the local-name@1.0 device to register processes with names locally, persistenting them across reboots.

Definitions of singleton processes are expected to be found with their names in the node_processes section of the node message.

Function Index

augment_definition/2*Augment the given process definition with the node's address.
generate_test_opts/0*Helper function to generate a test environment and its options.
generate_test_opts/1*
info/1Register a default handler for the device.
lookup/4*Lookup a process by name.
lookup_execute_test/0*Test that a process can be spawned, executed upon, and its result retrieved.
lookup_no_spawn_test/0*
lookup_spawn_test/0*
spawn_register/2*Spawn a new process according to the process definition found in the node message, and register it with the given name.

Function Details

augment_definition/2 *

augment_definition(BaseDef, Opts) -> any()

Augment the given process definition with the node's address.

generate_test_opts/0 *

generate_test_opts() -> any()

Helper function to generate a test environment and its options.

generate_test_opts/1 *

generate_test_opts(Defs) -> any()

info/1

info(Opts) -> any()

Register a default handler for the device. Inherits keys and set from the default device.

lookup/4 *

lookup(Name, Base, Req, Opts) -> any()

Lookup a process by name.

lookup_execute_test/0 *

lookup_execute_test() -> any()

Test that a process can be spawned, executed upon, and its result retrieved.

lookup_no_spawn_test/0 *

lookup_no_spawn_test() -> any()

lookup_spawn_test/0 *

lookup_spawn_test() -> any()

spawn_register/2 *

spawn_register(Name, Opts) -> any()

Spawn a new process according to the process definition found in the node message, and register it with the given name.