mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-13 07:41:11 +01:00
33 lines
618 B
Rust
33 lines
618 B
Rust
|
//! Processor responsible for receiving events, filtering them, and scheduling actions in response.
|
||
|
|
||
|
use std::time::Duration;
|
||
|
|
||
|
use tokio::sync::{mpsc, watch};
|
||
|
|
||
|
use crate::{
|
||
|
error::{CriticalError, RuntimeError},
|
||
|
event::Event,
|
||
|
};
|
||
|
|
||
|
#[derive(Clone, Debug)]
|
||
|
#[non_exhaustive]
|
||
|
pub struct WorkingData {
|
||
|
pub throttle: Duration,
|
||
|
}
|
||
|
|
||
|
impl Default for WorkingData {
|
||
|
fn default() -> Self {
|
||
|
Self {
|
||
|
throttle: Duration::from_millis(100),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
pub async fn worker(
|
||
|
mut working: watch::Receiver<WorkingData>,
|
||
|
errors: mpsc::Sender<RuntimeError>,
|
||
|
events: mpsc::Receiver<Event>,
|
||
|
) -> Result<(), CriticalError> {
|
||
|
Ok(())
|
||
|
}
|