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

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.

Link to this function

conn_id(parent, nsqd)

Given a consumer state object and an nsqd host/port tuple, return the connection ID.

Link to this function

delete(agent_pid, conn_id)

Delete connection info matching conn_id. This should be called when a connection is terminated.

Link to this function

fetch(agent_pid, conn_id)

Get info for the connection matching conn_id.

Link to this function

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)
@spec init(map()) :: any()
Link to this function

reduce(agent_pid, start_acc, func)

func is passed conn_info for each connection.

Link to this function

update(map, func)

Link to this function

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.