{"repo":"twilight-rs/gateway-queue","free":true,"listed":false,"github":"https://github.com/twilight-rs/gateway-queue","clone":"git clone https://github.com/twilight-rs/gateway-queue.git","description":"Ratelimited gateway queue for multiserviced bots.","language":"Rust","stars":24,"topics":["cache","discord-api","discord-bot","discord","ratelimiter","rust","twilight-rs"],"license":"ISC","category":"chat-messaging","readme_excerpt":"[![ci-badge][]][ci] [![license-badge][]][license] [![docs-badge][]][docs] [![rust badge]][rust link] Gateway Queue If your bot's shards are multi-processed, then a good choice is to use the [Gateway Queue]. The Gateway Queue is a lightweight but powerful application that you can host to queue shards across all of your processes. The Gateway Queue is library and language agnostic, it's an HTTP server that you call whenever a shard needs to reconnect to the gateway. How it works When one of your shards disconnects and needs to perform a full reconnect, it needs to start a new session with the gateway. If you have multiple processes managing shards, you may not have communication between these processes. The problems start to happen when multiple shards from these processes try to reconnect at the same time, all but 1 will get rate-limited. This is because there's a 5 second ratelimit between new sessions. By sending an HTTP request to the Gateway Queue, it will ratelimit the requests and \"stall\" them, responding with a friendly message once that shard can reconnect: Example The API is pretty minimal. It's just an HTTP request: No headers, body, or particular method need to be set, they're all ignored. The request will get a response once the request has gone through the queue. Using with large bots If the bot has access to bucketed identify, you will have to make slight configuration changes. Firstly you will need to set the DISCORD TOKEN environment variable so that it is able","default_branch":null,"files":null,"tree":[],"storefront":"/r/twilight-rs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/twilight-rs/gateway-queue/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}