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

Link to this function

conn_from_nsqd(cons, nsqd, cons_state)

@spec now() :: integer()
Link to this function

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.

Link to this function

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.