pub struct WikiIndexer { /* private fields */ }Expand description
The daemon’s SessionWiki sync job.
Triggers coalesce: a request while a sync is running marks a rerun instead of queueing a second one, so a burst of closing sessions costs one extra pass. Syncs are single-flight because SessionWiki holds a write transaction per adapter batch, and two writers only produce a busy error.
Implementations§
Source§impl WikiIndexer
impl WikiIndexer
Sourcepub fn spawn() -> Self
pub fn spawn() -> Self
Start the background sync worker. Without a Tokio runtime (some tests build a runtime state without one) the indexer stays inert.
Sourcepub fn request_sync(&self, full: bool)
pub fn request_sync(&self, full: bool)
Ask for a sync. Returns immediately; the work happens in the background.
Sourcepub async fn sync_now(&self, full: bool) -> Result<()>
pub async fn sync_now(&self, full: bool) -> Result<()>
Run a sync and wait for it, joining a sync already in flight.
Sourcepub fn status(&self) -> WikiStatus
pub fn status(&self) -> WikiStatus
The state of the index and whether a sync is running, for the surfaces that say so while the first build is under way.
Sourcepub fn last_success(&self) -> Option<Instant>
pub fn last_success(&self) -> Option<Instant>
When the last sync succeeded, for callers that trigger on staleness.
Auto Trait Implementations§
impl !RefUnwindSafe for WikiIndexer
impl !UnwindSafe for WikiIndexer
impl Freeze for WikiIndexer
impl Send for WikiIndexer
impl Sync for WikiIndexer
impl Unpin for WikiIndexer
impl UnsafeUnpin for WikiIndexer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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