BEAMNotify.env
env
, go back to BEAMNotify module for more information.
Specs
env(pid() | binary() | atom() | keyword()) :: Enumerable.t()
Return the OS environment needed to call $BEAM_NOTIFY
This returns a map that can be passed directly to System.cmd/3
via its
:env
option.
This function can be passed different things based on what's convenient.
If you're setting up
child_spec
's for a supervision tree and need the environment to pass in anotherchild_spec
, call this with the same options that you'd pass tostart_link/1
. This is a very common use.If you called
start_link/1
manually and have the pid, call it with the pid.If you only have the name that was passed to
start_link/1
, then call it with the name. The name alone is insufficient for returning the$BEAM_NOTIFY_OPTIONS
environment variable, so theBEAMNotify
GenServer must be running. If you're in a chicken-and-egg situation where you're setting up a supervision tree, but it hasn't been started yet, see option 1.