fix tests
This commit is contained in:
parent
e2b69487aa
commit
c3017df1c2
|
@ -8,6 +8,11 @@ use chorus::{
|
||||||
use std::{sync::Arc, time::Duration};
|
use std::{sync::Arc, time::Duration};
|
||||||
use tokio::{self};
|
use tokio::{self};
|
||||||
|
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
use safina_timer::sleep_for;
|
||||||
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
use wasmtimer::tokio::sleep_for;
|
||||||
|
|
||||||
// This example creates a simple gateway connection and a basic observer struct
|
// This example creates a simple gateway connection and a basic observer struct
|
||||||
|
|
||||||
// Due to certain limitations all observers must impl debug
|
// Due to certain limitations all observers must impl debug
|
||||||
|
@ -54,10 +59,12 @@ async fn main() {
|
||||||
let mut identify = GatewayIdentifyPayload::common();
|
let mut identify = GatewayIdentifyPayload::common();
|
||||||
identify.token = token;
|
identify.token = token;
|
||||||
gateway.send_identify(identify).await;
|
gateway.send_identify(identify).await;
|
||||||
|
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
safina_timer::start_timer_thread();
|
safina_timer::start_timer_thread();
|
||||||
|
|
||||||
// Do something on the main thread so we don't quit
|
// Do something on the main thread so we don't quit
|
||||||
loop {
|
loop {
|
||||||
safina_timer::sleep_for(Duration::MAX).await
|
sleep_for(Duration::MAX).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue