Pool.Server
Tracks atom <-> PID relationships for listeners.
PIDs are monitored in the Pool.Server
process.
Summary↑
get_listener(ref) | Gets a listener |
handle_call(msg, from, state) | Inserts a listener into the ets table with a monitor reference kept in state |
handle_info(arg1, state) | Removes the listener from the ets table on exit |
init(args) | Creates a monitor reference for any listeners that may already exist in the ets table |
set_listener(ref, pid) | Sets a listener |
start_link() |
Types ↑
ref :: atom
struct :: term
Functions
Specs:
- get_listener(ref) :: pid
Gets a listener pid
by a given ref
.
Arguments
ref
-atom
- reference for a listener process
Returns
pid
Specs:
Inserts a listener into the ets table with a monitor reference kept in state.
Specs:
Removes the listener from the ets table on exit.
Specs:
Creates a monitor reference for any listeners that may already exist in the ets table.
Specs:
- set_listener(ref, pid) :: :ok
Sets a listener pid
for a given ref
. The ref
should be an identifier for the process passed to
Pool.start_listener/7
.
Arguments
ref
-atom
- reference for a listener processpid
-pid
- the listener PID
Returns
:ok
Specs:
- start_link :: {:ok, pid}