prefer CancellationToken / Notify to channel

This commit is contained in:
Ferdinand Schober
2024-07-10 22:03:56 +02:00
parent 8ba92ede34
commit 9c0a40563e
4 changed files with 92 additions and 57 deletions

View File

@@ -59,6 +59,7 @@ pub fn new(
CaptureEvent::Destroy(h) => capture.destroy(h).await?,
CaptureEvent::Restart => {
let clients = server.client_manager.borrow().get_client_states().map(|(h, (c,_))| (h, c.pos)).collect::<Vec<_>>();
capture.async_drop().await?;
capture = input_capture::create(backend).await?;
for (handle, pos) in clients {
capture.create(handle, pos.into()).await?;