pub struct ActivityMonitor { /* private fields */ }Expand description
Background filesystem activity monitor.
Poll-loop ownership is elected across processes with a PollLock. Only the
process that acquires the lock runs the poll thread (the poll leader);
other processes still construct an ActivityMonitor but with
poll_leader == false and no thread, relying on HEAD-only updates so that
commits / activity events are never duplicated.
Implementations§
Source§impl ActivityMonitor
impl ActivityMonitor
Sourcepub fn try_start(
store_root: &Path,
config: MergedConfig,
manifest: Arc<Mutex<Manifest>>,
agent_state: AgentState,
ui_tx: Option<Sender<UiEvent>>,
) -> Result<Self>
pub fn try_start( store_root: &Path, config: MergedConfig, manifest: Arc<Mutex<Manifest>>, agent_state: AgentState, ui_tx: Option<Sender<UiEvent>>, ) -> Result<Self>
Start the poll loop if this process can become the poll leader.
Always returns a monitor: when the poll lock is already held by another
process the returned monitor has no poll thread (is_poll_leader() is
false).
Sourcepub fn is_poll_leader(&self) -> bool
pub fn is_poll_leader(&self) -> bool
Whether this monitor owns the cross-process poll loop.
Auto Trait Implementations§
impl Freeze for ActivityMonitor
impl RefUnwindSafe for ActivityMonitor
impl Send for ActivityMonitor
impl Sync for ActivityMonitor
impl Unpin for ActivityMonitor
impl UnsafeUnpin for ActivityMonitor
impl UnwindSafe for ActivityMonitor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more