From 739f2c8b71b634812ee8a6c73a6411c94e93c6ed Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Thu, 16 Nov 2023 16:24:02 +0100 Subject: [PATCH] Create wasm gateway module --- src/gateway/wasm/gateway.rs | 2 +- src/gateway/wasm/heartbeat.rs | 14 ++++++++++++++ src/gateway/wasm/mod.rs | 5 ++++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/gateway/wasm/heartbeat.rs diff --git a/src/gateway/wasm/gateway.rs b/src/gateway/wasm/gateway.rs index 8b13789..5a54efb 100644 --- a/src/gateway/wasm/gateway.rs +++ b/src/gateway/wasm/gateway.rs @@ -1 +1 @@ - +use ws_stream_wasm::*; diff --git a/src/gateway/wasm/heartbeat.rs b/src/gateway/wasm/heartbeat.rs new file mode 100644 index 0000000..b7346fa --- /dev/null +++ b/src/gateway/wasm/heartbeat.rs @@ -0,0 +1,14 @@ +use tokio::task::JoinHandle; + +use super::*; + +#[allow(dead_code)] // FIXME: Remove this, once used +#[derive(Debug)] +pub struct WasmHeartbeatHandler { + /// How ofter heartbeats need to be sent at a minimum + pub heartbeat_interval: Duration, + /// The send channel for the heartbeat thread + pub send: Sender, + /// The handle of the thread + handle: JoinHandle<()>, +} diff --git a/src/gateway/wasm/mod.rs b/src/gateway/wasm/mod.rs index 73a5181..cdcf007 100644 --- a/src/gateway/wasm/mod.rs +++ b/src/gateway/wasm/mod.rs @@ -1,2 +1,5 @@ pub mod gateway; -pub use gateway::*; +pub mod heartbeat; +use super::*; +use gateway::*; +use heartbeat::*;