Modernize feresectl and add bounded IPC event streaming

This commit is contained in:
Samuel Onoja committed 2026-10-07 07:39:27 +01:00
1 parent cfdd2a148a
commit 97026a0db7
39 files changed
+1671 -254

No files matched your search

+13
View File
@@ -115,6 +115,19 @@ pub(crate) struct Lock {
}
impl Lock {
pub(crate) fn event_state(&self) -> ferese_ipc::events::LockState {
let phase = match self.lifecycle {
Lifecycle::Unlocked => "unlocked",
Lifecycle::Acquiring(_) => "acquiring",
Lifecycle::Locked(_) => "locked",
Lifecycle::Orphaned => "orphaned",
};
ferese_ipc::events::LockState {
phase: phase.into(),
sleeping: self.sleeping,
}
}
pub(crate) fn active(&self) -> bool {
!matches!(self.lifecycle, Lifecycle::Unlocked)
}