mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-24 05:53:20 +03:00
Async (#30)
- manual eventloop now replaced by asycn-await using the tokio runtime - dns no longer blocks the event loop - simplifies logic - makes xdg-desktop-portal easier to integrate
This commit is contained in:
committed by
GitHub
parent
d4d6f05802
commit
ab2514e508
@@ -1,12 +1,13 @@
|
||||
use std::io::Result;
|
||||
use std::os::fd::{AsRawFd, self};
|
||||
use std::vec::Drain;
|
||||
|
||||
use mio::{Token, Registry};
|
||||
use mio::event::Source;
|
||||
use std::io::Result;
|
||||
use tokio::io::unix::AsyncFd;
|
||||
|
||||
use crate::event::Event;
|
||||
use crate::producer::EventProducer;
|
||||
|
||||
use crate::{client::{ClientHandle, ClientEvent}, event::Event};
|
||||
use crate::client::{ClientEvent, ClientHandle};
|
||||
|
||||
pub struct X11Producer {
|
||||
pending_events: Vec<(ClientHandle, Event)>,
|
||||
@@ -20,27 +21,9 @@ impl X11Producer {
|
||||
}
|
||||
}
|
||||
|
||||
impl Source for X11Producer {
|
||||
fn register(
|
||||
&mut self,
|
||||
_registry: &Registry,
|
||||
_token: Token,
|
||||
_interests: mio::Interest,
|
||||
) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn reregister(
|
||||
&mut self,
|
||||
_registry: &Registry,
|
||||
_token: Token,
|
||||
_interests: mio::Interest,
|
||||
) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn deregister(&mut self, _registry: &Registry) -> Result<()> {
|
||||
Ok(())
|
||||
impl AsRawFd for X11Producer {
|
||||
fn as_raw_fd(&self) -> fd::RawFd {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +35,8 @@ impl EventProducer for X11Producer {
|
||||
}
|
||||
|
||||
fn release(&mut self) {}
|
||||
|
||||
fn get_async_fd(&self) -> Result<AsyncFd<fd::RawFd>> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user