twilight-gateway-queue

Crates.iotwilight-gateway-queue
lib.rstwilight-gateway-queue
version
sourcesrc
created_at2020-10-07 20:07:01.664044
updated_at2025-01-12 09:48:59.833257
descriptionDiscord Gateway connection queue implementation for the Twilight ecosystem.
homepagehttps://twilight.rs/
repositoryhttps://github.com/twilight-rs/twilight.git
max_upload_size
id297069
Cargo.toml error:TOML parse error at line 24, column 1 | 24 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Erk (Erk-)

documentation

README

twilight-gateway-queue

codecov badge discord badge github badge license badge rust badge

Rate limiting functionality for gateway IDENTIFY commands.

Discord allows bot's shards to send a limited amount of IDENTIFY commands every 5 seconds, with a daily limit from 1000 to 2000 commands, and invalidates all shard sessions upon exceeding it. Each identify interval may be filled by shards' IDs modulo max_concurrency and such a set of shards is called a bucket. See Discord Docs/Sharding.

To coordinate this, a [Queue] should process each identify request and shards should wait for its signal to proceed before continuing and otherwise retry. The provided [InMemoryQueue] never fails or cancels requests and is therefore a good starting point for custom implementations. It can also be composed to support multiple processes; see gateway-queue-http and gateway-queue for a HTTP client and server implementation, respectively.

Commit count: 2436

cargo fmt