GenServer.whereis
You're seeing just the function
whereis
, go back to GenServer module for more information.
Specs
Returns the pid
or {name, node}
of a GenServer process, nil
otherwise.
To be precise, nil
is returned whenever a pid
or {name, node}
cannot
be returned. Note there is no guarantee the returned pid
or {name, node}
is alive, as a process could terminate immediately after it is looked up.
Examples
For example, to lookup a server process, monitor it and send a cast to it:
process = GenServer.whereis(server)
monitor = Process.monitor(process)
GenServer.cast(process, :hello)