Skip to content

Instantly share code, notes, and snippets.

View Globidev's full-sized avatar
🎯
Focusing

Guillaume Depardon Globidev

🎯
Focusing
  • Paris, France
View GitHub Profile
@Globidev
Globidev / viewer.rs
Created October 8, 2019 02:10 — forked from anlumo/viewer.rs
pub async fn run(mut self) -> Result<(), Box<dyn std::error::Error>> {
loop {
match select(self.stream.next(), self.channel.next()).await {
Either::Left((Some(Ok(message)), _)) => {
match message {
Message::Text(txt) => {
debug!("[{}] Received message: {:?}", self.uuid, txt);
},
Message::Binary(bin) => {
debug!("[{}] Received binary message: {:?}", self.uuid, bin);