Update client.rs

added tokio, to protect client connections.
This commit is contained in:
michael-bailey 2022-03-01 22:57:47 +00:00
parent 2783c381e0
commit 90d8ead026
1 changed files with 4 additions and 1 deletions

View File

@ -133,9 +133,12 @@ impl<Out> IManager for Client<Out>
}
async fn run(self: &Arc<Self>) {
let client = self.clone();
select! {
val = self.connection.read::<ClientStreamIn>() => {
self.handle_connection(val).await;
tokio::spawn(async move {
client.handle_connection(val).await;
});
}
}
}