Boltun.Listener

Listens to Postgrex notifications and invokes the registed callbacks.

Summary

add_callback(listener, channel, value)

Adds a callback to the given channel

remove_channel(listener, channel)

Removes all callbacks for the given channel

start_link(opts, server_opts)

Starts a listener. Expects a keyword list with the following parameters

  • :connection => pid or name of the connection to the database
  • :callbacks_agent => pid or name of the agent keeping track of the callbacks
stop(listener)

Stops this listener and deregisters all channels

Functions

add_callback(listener, channel, value)

Adds a callback to the given channel

remove_channel(listener, channel)

Removes all callbacks for the given channel

start_link(opts, server_opts)

Starts a listener. Expects a keyword list with the following parameters

  • :connection => pid or name of the connection to the database
  • :callbacks_agent => pid or name of the agent keeping track of the callbacks

    and a keyword list with GenServer specific options, like :name.

stop(listener)

Stops this listener and deregisters all channels