This commit is contained in:
Brandon Thomas committed 2022-01-09 21:14:15 -05:00
1 parent cb5a135f68
commit 6b03fb84c5
2 files changed
+22 -18

No files matched your search

@@ -135,29 +135,33 @@ impl StreamHandler<Result<ws::Message, ws::ProtocolError>> for ObsGatewayWebSock
//let res = rx.recv().unwrap();
let handle = Handle::current();
//let handle = Handle::current();
handle.spawn(async move {
//error!("Twitch PubSub Try read next...");
//match client2.try_next().await {
// Ok(r) => {
// error!("Twitch PubSub Result: {:?}", r);
// },
// Err(e) => {
// warn!("pubsub error: {:?}", e);
// }
//}
loop {
info!("thread loop");
sleep(Duration::from_millis(1000));
}
});
//handle.spawn(async move {
// //error!("Twitch PubSub Try read next...");
// //match client2.try_next().await {
// // Ok(r) => {
// // error!("Twitch PubSub Result: {:?}", r);
// // },
// // Err(e) => {
// // warn!("pubsub error: {:?}", e);
// // }
// //}
// loop {
// info!("thread loop");
// sleep(Duration::from_millis(1000));
// }
//});
info!("after thread spawn");
info!("process message: {:?}", &msg);
match msg {
ws::Message::Text(text) => ctx.text(text),
ws::Message::Text(text) => {
info!("sending text response");
ctx.text("hello from Rust")
},
ws::Message::Binary(bin) => ctx.binary(bin),
ws::Message::Ping(bytes) => ctx.pong(&bytes),
ws::Message::Close(reason) => {
+1 -1
View File
@@ -21,7 +21,7 @@
setInterval(() => {
console.log('sending browser message to server on interval');
sock.send('interval trigger');
sock.send('interval trigger from browser');
}, 2000);
//setTimeout(() => {