mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-13 21:32:18 +00:00
OBS WIP
This commit is contained in:
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) => {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user