- 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:
Ferdinand Schober
2023-10-11 14:52:18 +02:00
committed by GitHub
parent d4d6f05802
commit ab2514e508
13 changed files with 453 additions and 565 deletions

View File

@@ -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!()
}
}