diff --git a/examples/gateway_observers.rs b/examples/gateway_observers.rs index 5ea6506..b265dc5 100644 --- a/examples/gateway_observers.rs +++ b/examples/gateway_observers.rs @@ -11,7 +11,7 @@ use tokio::{self}; #[cfg(not(target_arch = "wasm32"))] use safina_timer::sleep_for; #[cfg(target_arch = "wasm32")] -use wasmtimer::tokio::sleep_for; +use wasmtimer::tokio::sleep; // This example creates a simple gateway connection and a basic observer struct @@ -65,6 +65,9 @@ async fn main() { // Do something on the main thread so we don't quit loop { - sleep_for(Duration::MAX).await + #[cfg(not(target_arch = "wasm32"))] + sleep_for(Duration::MAX).await; + #[cfg(target_arch = "wasm32")] + sleep(Duration::MAX).await; } } diff --git a/examples/gateway_simple.rs b/examples/gateway_simple.rs index de6bd5d..aaa0195 100644 --- a/examples/gateway_simple.rs +++ b/examples/gateway_simple.rs @@ -6,7 +6,7 @@ use chorus::{self, types::GatewayIdentifyPayload}; #[cfg(not(target_arch = "wasm32"))] use safina_timer::sleep_for; #[cfg(target_arch = "wasm32")] -use wasmtimer::tokio::sleep_for; +use wasmtimer::tokio::sleep; /// This example creates a simple gateway connection and a session with an Identify event #[tokio::main(flavor = "current_thread")] @@ -38,6 +38,9 @@ async fn main() { // Do something on the main thread so we don't quit loop { - sleep_for(Duration::MAX).await + #[cfg(not(target_arch = "wasm32"))] + sleep_for(Duration::MAX).await; + #[cfg(target_arch = "wasm32")] + sleep(Duration::MAX).await; } }