Pool.Server

Tracks atom <-> PID relationships for listeners. PIDs are monitored in the Pool.Server process.

Source

Summary

get_listener(ref)

Gets a listener pid by a given ref

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 pid for a given ref. The ref should be an identifier for the process passed to Pool.start_listener/7

start_link()

Types

ref :: atom

struct :: term

Functions

get_listener(ref)

Specs:

  • get_listener(ref) :: pid

Gets a listener pid by a given ref.

Arguments

  • ref - atom - reference for a listener process

Returns

pid

Source
handle_call(msg, from, state)

Specs:

  • handle_call({atom, atom, pid}, {pid, term}, struct) :: {:reply, true | false, struct}

Inserts a listener into the ets table with a monitor reference kept in state.

Source
handle_info(arg1, state)

Specs:

  • handle_info({atom, reference, atom, pid, term}, struct) :: {:noreply, struct}

Removes the listener from the ets table on exit.

Source
init(args)

Specs:

Creates a monitor reference for any listeners that may already exist in the ets table.

Source
set_listener(ref, pid)

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 process
  • pid - pid - the listener PID

Returns

:ok

Source
start_link()

Specs:

  • start_link :: {:ok, pid}
Source