crux_gateway v0.1.1 Crux.Gateway.IdentifyLimiter View Source

Handles the Identifying rate limit of 1 per 5 seconds.

This module is automatically used by Crux.Gateway.Connection, you do not need to worry about it.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Starts the module if necessary and queues the packet.
Blocks the process until the identify may be sent

Starts the identify limiter

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function queue(packet, shard_id \\ nil) View Source
queue(packet :: term(), shard_id :: non_neg_integer()) :: term()

Starts the module if necessary and queues the packet.
Blocks the process until the identify may be sent.

The packets will return in the order as they arrive at the rate limiter, those are sent via GenServer.call/2.
Returns the packet as is.

Automatically used by Crux.Gateway.Connection.

Starts the identify limiter.