Patch.Listener (patch v0.8.0) View Source

Link to this section Summary

Types

Option to control whether or not to capture GenServer.call replies.

Sum-type of all valid options

t()

Listeners are started with a tag so the listening process can differentiate between multiple listeners.

Listeners listen to a target.

Option to control how long the listener should wait for GenServer.call

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Link to this section Types

Link to this type

capture_replies_option()

View Source

Specs

capture_replies_option() :: {:capture_replies, boolean()}

Option to control whether or not to capture GenServer.call replies.

Defaults to true

Specs

Sum-type of all valid options

Specs

t() :: %Patch.Listener{
  capture_replies: boolean(),
  recipient: pid(),
  tag: atom(),
  target: pid(),
  timeout: timeout()
}

Specs

tag() :: atom()

Listeners are started with a tag so the listening process can differentiate between multiple listeners.

Specs

target() :: GenServer.server()

Listeners listen to a target.

Specs

timeout_option() :: {:timeout, timeout()}

Option to control how long the listener should wait for GenServer.call

Value is either the number of milliseconds to wait or the :infinity atom.

If capture_replies is set to false this setting has no effect.

Defaults to 5000

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

init(t()) :: {:ok, t()}

Callback implementation for GenServer.init/1.

Link to this function

start_link(recipient, tag, target, options \\ [])

View Source

Specs

start_link(recipient :: atom(), tag :: tag(), target :: pid() | atom(), [
  option()
]) :: {:ok, pid()} | {:error, :not_found}