From 32b163a4c71da2347ad0fcd5ecd4989e19daca79 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Tue, 14 Nov 2023 15:43:08 +0100 Subject: [PATCH] Move HEARTBEAT_ACK_TIMEOUT Delete events.rs Unify import Move HEARTBEAT_ACK_TIMEOUT since its not an OPCODE --- src/gateway/events.rs | 1 - src/gateway/gateway.rs | 1 - src/gateway/handle.rs | 3 +-- src/gateway/heartbeat.rs | 3 +++ src/gateway/mod.rs | 3 --- 5 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 src/gateway/events.rs diff --git a/src/gateway/events.rs b/src/gateway/events.rs deleted file mode 100644 index 8b13789..0000000 --- a/src/gateway/events.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/gateway/gateway.rs b/src/gateway/gateway.rs index 026f92f..30d0610 100644 --- a/src/gateway/gateway.rs +++ b/src/gateway/gateway.rs @@ -1,5 +1,4 @@ use self::event::Events; - use super::*; use crate::types::{ self, AutoModerationRule, AutoModerationRuleUpdate, Channel, ChannelCreate, ChannelDelete, diff --git a/src/gateway/handle.rs b/src/gateway/handle.rs index 4e21f2b..1200b30 100644 --- a/src/gateway/handle.rs +++ b/src/gateway/handle.rs @@ -1,5 +1,4 @@ -use super::event::Events; -use super::*; +use super::{event::Events, *}; use crate::types::{self, Composite}; /// Represents a handle to a Gateway connection. A Gateway connection will create observable diff --git a/src/gateway/heartbeat.rs b/src/gateway/heartbeat.rs index 2f443c8..dd162b7 100644 --- a/src/gateway/heartbeat.rs +++ b/src/gateway/heartbeat.rs @@ -2,6 +2,9 @@ use crate::types; use super::*; +/// The amount of time we wait for a heartbeat ack before resending our heartbeat in ms +const HEARTBEAT_ACK_TIMEOUT: u64 = 2000; + /// Handles sending heartbeats to the gateway in another thread #[allow(dead_code)] // FIXME: Remove this, once HeartbeatHandler is used #[derive(Debug)] diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs index fc0e21d..ebd06cc 100644 --- a/src/gateway/mod.rs +++ b/src/gateway/mod.rs @@ -82,9 +82,6 @@ const GATEWAY_CALL_SYNC: u8 = 13; /// See [types::LazyRequest] const GATEWAY_LAZY_REQUEST: u8 = 14; -/// The amount of time we wait for a heartbeat ack before resending our heartbeat in ms -const HEARTBEAT_ACK_TIMEOUT: u64 = 2000; - pub type ObservableObject = dyn Send + Sync + Any; /// An entity type which is supposed to be updateable via the Gateway. This is implemented for all such types chorus supports, implementing it for your own types is likely a mistake.