mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-17 18:20:54 +03:00
use local-channel instead of tokio sync channel (#179)
this avoids the mutex overhead in tokio
This commit is contained in:
committed by
GitHub
parent
19c2c4327f
commit
e7a1d72149
@@ -1,12 +1,9 @@
|
||||
use futures::StreamExt;
|
||||
use lan_mouse_proto::ProtoEvent;
|
||||
use local_channel::mpsc::{Receiver, Sender};
|
||||
use std::net::SocketAddr;
|
||||
|
||||
use tokio::{
|
||||
process::Command,
|
||||
sync::mpsc::{Receiver, Sender},
|
||||
task::JoinHandle,
|
||||
};
|
||||
use tokio::{process::Command, task::JoinHandle};
|
||||
|
||||
use input_capture::{
|
||||
self, CaptureError, CaptureEvent, CaptureHandle, InputCapture, InputCaptureError, Position,
|
||||
@@ -161,7 +158,7 @@ async fn handle_capture_event(
|
||||
/* released capture */
|
||||
State::Receiving => ProtoEvent::Leave(0),
|
||||
};
|
||||
sender_tx.send((event, addr)).await.expect("sender closed");
|
||||
sender_tx.send((event, addr)).expect("sender closed");
|
||||
};
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user