NSQ.Consumer.Helpers (elixir_nsq v1.2.0)
Summary
Functions
Returns how much max_in_flight
should be distributed to each connection.
If max_in_flight
is less than the number of connections, then this always
returns 1 and they are randomly distributed via redistribute_rdy
. Not for
external use.
Each connection is responsible for maintaining its own rdy_count in ConnInfo. This function sums all the values of rdy_count for each connection, which lets us get an accurate picture of a consumer's total RDY count. Not for external use.
Functions
conn_from_nsqd(cons, nsqd, cons_state)
@spec conn_from_nsqd(pid(), NSQ.Consumer.host_with_port(), NSQ.Consumer.state()) :: NSQ.Consumer.connection()
now()
@spec now() :: integer()
per_conn_max_in_flight(cons_state)
@spec per_conn_max_in_flight(NSQ.Consumer.state()) :: integer()
Returns how much max_in_flight
should be distributed to each connection.
If max_in_flight
is less than the number of connections, then this always
returns 1 and they are randomly distributed via redistribute_rdy
. Not for
external use.
total_rdy_count(agent_pid)
@spec total_rdy_count(pid()) :: integer()
@spec total_rdy_count(NSQ.Consumer.state()) :: integer()
Each connection is responsible for maintaining its own rdy_count in ConnInfo. This function sums all the values of rdy_count for each connection, which lets us get an accurate picture of a consumer's total RDY count. Not for external use.