pub struct DaemonManager { /* private fields */ }Expand description
Manages the lifecycle of the Syncor daemon process.
Responsibilities:
- Write / remove the PID file.
- Load the links registry on startup.
- Run a command loop (IPC commands forwarded here once the IPC server is available; for now a placeholder channel is used).
- Clean up stale PID / socket files left by crashed processes.
Implementations§
Source§impl DaemonManager
impl DaemonManager
pub fn new(paths: SyncorPaths, config: SyncorConfig) -> Self
Sourcepub async fn run(&self) -> Result<()>
pub async fn run(&self) -> Result<()>
Run the daemon.
- Write the PID file.
- Load the links registry.
- Enter the command loop (placeholder channel until the IPC server is wired in).
- Remove the PID file on exit.
Sourcepub fn is_running(paths: &SyncorPaths) -> bool
pub fn is_running(paths: &SyncorPaths) -> bool
Returns true if a daemon process described by the PID file is alive.
Sourcepub fn cleanup_stale(paths: &SyncorPaths)
pub fn cleanup_stale(paths: &SyncorPaths)
Remove a stale PID file and Unix-domain socket that were left behind by a previously crashed daemon.
Auto Trait Implementations§
impl Freeze for DaemonManager
impl RefUnwindSafe for DaemonManager
impl Send for DaemonManager
impl Sync for DaemonManager
impl Unpin for DaemonManager
impl UnsafeUnpin for DaemonManager
impl UnwindSafe for DaemonManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more