Paxtor.StartChild (paxtor v0.3.0)

Summary

Functions

Checks if the given key has a running, alive process in the cluster.

Ensures the process represented by key and child_spec is started, and it returns the pid of the process. In case of an unexpected problem it can return :undefined or nil.

Returns a :via tuple that represents the process behind the key.

Returns the pid of the process behind key. If the process in not yet started, it starts the process using child_spec and returns the newly created pid.

Functions

alive?(key)

Checks if the given key has a running, alive process in the cluster.

ensure_started(key, child_spec)

Ensures the process represented by key and child_spec is started, and it returns the pid of the process. In case of an unexpected problem it can return :undefined or nil.

lookup(key)

via(key, child_spec)

Returns a :via tuple that represents the process behind the key.

Ths via tuple can be used in place of a process name, and it resolves to the pid behind key. To resolve it, you can use Paxtor.whereis/, or most of the standart OTP functions that take not only pids, but also process names, like GenServer.call.

There is no process started by just creating a via tuple, but resolving the via tuple (like Paxtor.whereis(via_tuple)) starts the process in case it was not started yet.

whereis(key, child_spec)

Returns the pid of the process behind key. If the process in not yet started, it starts the process using child_spec and returns the newly created pid.