pub struct Daemon { /* private fields */ }Expand description
What a connection needs to answer the sealed surface.
Implementations§
Source§impl Daemon
impl Daemon
Sourcepub fn new(store: PgEventStore, public_revision: String) -> Result<Self>
pub fn new(store: PgEventStore, public_revision: String) -> Result<Self>
public_revision is the build’s own 40-hex revision, which status
reports so a client can compare a running daemon against the one genesis
recorded. It is required rather than defaulted: a daemon that reported a
placeholder would make that comparison answer “same” for two different
builds.
The writer epoch is READ OFF the store rather than passed in, because
there is exactly one way to obtain one — claim_epoch, which BUMPS the
durable counter — and the store already did it when it opened. A caller
handed this as a parameter would have had to claim a second time, and a
second claim is not a second opinion about the epoch: it supersedes the
first, so the store this daemon is about to serve from would be fenced
out of its own log by the daemon in front of it.
A blob store is likewise required rather than optional. A store without
one is a real state — admin init and the certifier drive the log with no
filesystem at all — but a SERVING kernel in that state would answer every
blob request with a refusal that says nothing about the request, and the
operator would find out from a client rather than from a start-up that
failed.
Sourcepub fn notify_on_append(&self)
pub fn notify_on_append(&self)
Start the listener that turns database notifications into wake-ups.
Separate from Daemon::new because it spawns, and a constructor that
needed a running runtime to exist would be a trap for any caller that
builds a daemon before starting one. A daemon that never calls this still
serves subscriptions correctly — every one of them re-reads on
SUBSCRIPTION_POLL_SECS regardless — at poll latency instead of
notification latency.
Auto Trait Implementations§
impl !RefUnwindSafe for Daemon
impl !UnwindSafe for Daemon
impl Freeze for Daemon
impl Send for Daemon
impl Sync for Daemon
impl Unpin for Daemon
impl UnsafeUnpin for Daemon
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
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