z_proc (zotonic_core v1.0.0-rc.17)
Process registry interface for a site and proc_lib routines to spawn new processes whilst keeping the logger metadata.
Summary
Functions
Register a Pid under Name. Name can be any erlang term.
Spawn a new process using proc_lib and copy the logger metadata from the calling process to the new process.
Spawn a new process using proc_lib and copy the logger metadata from the calling process to the new process.
Spawn a new process using proc_lib and copy the logger metadata from the calling process to the new process. Pass options to proc_lib for spawning the process.
Unregister the current process.
Lookup the pid of the process.
Functions
-spec register(Name, Pid, Site) -> ok | {error, duplicate} when Name :: term(), Pid :: pid(), Site :: z:context() | atom().
Register a Pid under Name. Name can be any erlang term.
Spawn a new process using proc_lib and copy the logger metadata from the calling process to the new process.
Spawn a new process using proc_lib and copy the logger metadata from the calling process to the new process.
-spec spawn_md_opt(Fun, SpawnOpts) -> Pid | {Pid, Reference} when Fun :: function(), SpawnOpts :: [proc_lib:spawn_option()], Pid :: pid(), Reference :: reference().
Spawn a new process using proc_lib and copy the logger metadata from the calling process to the new process. Pass options to proc_lib for spawning the process.
-spec unregister(Name, Site) -> ok | {error, enoent} when Name :: term(), Site :: z:context() | atom().
Unregister the current process.
Lookup the pid of the process.