NSQ.ConnInfo (elixir_nsq v1.2.0)
Summary
Functions
Get info for all connections in a map like %{conn_id: %{... data ...}}.
Given a conn object return by Consumer.get_connections or connection state object, return the
connection ID.
Given a consumer state object and an nsqd host/port tuple, return the connection ID.
Delete connection info matching conn_id. This should be called when a
connection is terminated.
Get info for the connection matching conn_id.
Get specific data for the connection, e.g.
func is passed conn_info for each connection.
Update the info for a specific connection matching conn_id.
If a function is supplied conn_infois passed to func, and the result of func is saved as the new conn_info.
if a map is supplied, the map is merged into the existing conn_info.
Functions
all(agent_pid)
Get info for all connections in a map like %{conn_id: %{... data ...}}.
conn_id(conn)
Given a conn object return by Consumer.get_connections or connection state object, return the
connection ID.
conn_id(parent, nsqd)
Given a consumer state object and an nsqd host/port tuple, return the connection ID.
delete(agent_pid, conn_id)
Delete connection info matching conn_id. This should be called when a
connection is terminated.
fetch(agent_pid, conn_id)
Get info for the connection matching conn_id.
fetch(agent_pid, conn_id, keys)
Get specific data for the connection, e.g.:
[rdy_count, last_rdy] = fetch(pid, "conn_id", [:rdy_count, :last_rdy])
rdy_count = fetch(pid, "conn_id", :rdy_count)
init(state)
reduce(agent_pid, start_acc, func)
func is passed conn_info for each connection.
update(map, func)
update(agent_pid, conn_id, func)
Update the info for a specific connection matching conn_id.
If a function is supplied conn_infois passed to func, and the result of func is saved as the new conn_info.
if a map is supplied, the map is merged into the existing conn_info.