mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
feat(gateway): add stopGateway function (#2078)
* Move the shard stopping to gatewayManager in order to stop the gateway standalone. * Update gateway/gateway_manager.ts Co-authored-by: ITOH <to@itoh.at> * Update gateway/stopGateway.ts Co-authored-by: ITOH <to@itoh.at> * Update gateway/stopGateway.ts * Update gateway/stopGateway.ts * Update gateway/stopGateway.ts Co-authored-by: ITOH <to@itoh.at> Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
import { resume } from "./resume.ts";
|
||||
import { sendShardMessage } from "./sendShardMessage.ts";
|
||||
import { prepareBuckets, spawnShards } from "./spawnShards.ts";
|
||||
import { stopGateway } from "./stopGateway";
|
||||
import { tellWorkerToIdentify } from "./tellWorkerToIdentify.ts";
|
||||
import { DiscordenoShard } from "./shard.ts";
|
||||
|
||||
@@ -88,6 +89,7 @@ export function createGatewayManager(
|
||||
handleOnMessage: options.handleOnMessage ?? handleOnMessage,
|
||||
processGatewayQueue: options.processGatewayQueue ?? processGatewayQueue,
|
||||
closeWS: options.closeWS ?? closeWS,
|
||||
stopGateway: options.stopGateway ?? stopGateway,
|
||||
sendShardMessage: options.sendShardMessage ?? sendShardMessage,
|
||||
resume: options.resume ?? resume,
|
||||
safeRequestsPerShard: options.safeRequestsPerShard ?? safeRequestsPerShard,
|
||||
@@ -209,6 +211,8 @@ export interface GatewayManager {
|
||||
processGatewayQueue: typeof processGatewayQueue;
|
||||
/** Closes shard WebSocket connection properly. */
|
||||
closeWS: typeof closeWS;
|
||||
/** Use this function to stop the gateway properly. */
|
||||
stopGateway: typeof stopGateway;
|
||||
/** Properly adds a message to the shards queue. */
|
||||
sendShardMessage: typeof sendShardMessage;
|
||||
/** Properly resume an old shards session. */
|
||||
|
||||
Reference in New Issue
Block a user