Baby.Connection.Registry (Baby v0.34.0)

View Source

A process registry for Baby.Connection

For maximum utility, name should be of the form: {host, port} where host is an internet address tuple and port is an integer

Summary

Functions

Return a list of all named connections

Check if a named connection is active

Send a message to all registered connections

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Send a message to a named connection

Functions

active()

Return a list of all named connections

active?(conn_name)

Check if a named connection is active

broadcast(message, except \\ [])

Send a message to all registered connections

Can include a list of names or pids to exclude

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(args)

Callback implementation for GenServer.init/1.

register_name(conn_name, pid)

send(conn_name, message)

Send a message to a named connection

start_link(args)

unregister_name(conn_name)

whereis_name(conn_name)