View Source Singleton (singleton v1.4.0)

Singleton.

The top supervisor of singleton is a DynamicSupervisor, started in your application's own OTP tree. Singleton can manage many singleton processes at the same time. Each singleton is identified by its unique name term.

Summary

Functions

Start a new singleton process. Optionally provide the on_conflict parameter which will be called whenever a singleton process shuts down due to another instance being present in the cluster.

Functions

Link to this function

start_child(supervisor_name, module, args, name, on_conflict \\ fn -> nil end)

View Source

Start a new singleton process. Optionally provide the on_conflict parameter which will be called whenever a singleton process shuts down due to another instance being present in the cluster.

This function needs to be executed on all nodes where the singleton process is allowed to live. The actual process will be started only once; a manager process is started on each node for each singleton to ensure that the process continues on (possibly) another node in case of node disconnects or crashes.

Link to this function

stop_child(supervisor_name, module, args)

View Source