Background service (#43)

better handling of background-service: lan-mouse can now be run without a gui by specifying --daemon as an argument.
Otherwise the servic will be run as a child process and correctly terminate when the window is closed / frontend exits.

Closes #38
This commit is contained in:
Ferdinand Schober
2023-12-09 00:36:01 +01:00
committed by GitHub
parent 9b242f6138
commit 56e5f7a30d
13 changed files with 488 additions and 170 deletions

View File

@@ -1,4 +1,5 @@
use std::{error::Error, io};
use anyhow::Result;
use std::io;
use futures_core::Stream;
@@ -15,7 +16,7 @@ enum Backend {
X11,
}
pub fn create() -> Result<Box<dyn EventProducer>, Box<dyn Error>> {
pub async fn create() -> Result<Box<dyn EventProducer>> {
#[cfg(windows)]
return Ok(Box::new(producer::windows::WindowsProducer::new()));