pub struct PendingBackgroundPids { /* private fields */ }Implementations§
Source§impl PendingBackgroundPids
impl PendingBackgroundPids
pub fn new() -> Self
Sourcepub fn global() -> &'static PendingBackgroundPids
pub fn global() -> &'static PendingBackgroundPids
The one pen of this srv. A pid is filed from srv’s own broker observer (background_task_pid) and a row is
created from either the pane’s docknodestatus or the CLI’s task feed in the stdout reader, which has no app
state to hold a pen of its own: all of them meet here.
Sourcepub fn set_or_stash<E>(
&self,
id: &str,
pid: i64,
now_ms: i64,
try_set: impl FnOnce(i64) -> Result<bool, E>,
) -> Result<(), E>
pub fn set_or_stash<E>( &self, id: &str, pid: i64, now_ms: i64, try_set: impl FnOnce(i64) -> Result<bool, E>, ) -> Result<(), E>
Called from the pid-arrival side (COMMAND_BACKGROUND_TASK_PID).
Runs try_set(pid) (the background_task_set_pid DB call) while
holding this module’s lock; if it reports the row doesn’t exist yet
(Ok(false)), stashes the pid instead of losing it. Atomic with
observe_and_apply below for the same id — see the module doc
comment for why that matters.
Sourcepub fn observe_and_apply<E>(
&self,
id: &str,
now_ms: i64,
apply: impl FnOnce(i64) -> Result<bool, E>,
) -> Result<(), E>
pub fn observe_and_apply<E>( &self, id: &str, now_ms: i64, apply: impl FnOnce(i64) -> Result<bool, E>, ) -> Result<(), E>
Called from the row-creation side (COMMAND_DOCK_NODE_STATUS),
after its own background_task_observe(...) call. Checks for a
pid stashed ahead of the row’s existence and, if present and not
expired, applies it via apply (another background_task_set_pid
call) while holding this module’s lock. Atomic with set_or_stash
above for the same id.
Trait Implementations§
Source§impl Default for PendingBackgroundPids
impl Default for PendingBackgroundPids
Source§fn default() -> PendingBackgroundPids
fn default() -> PendingBackgroundPids
Auto Trait Implementations§
impl !Freeze for PendingBackgroundPids
impl !RefUnwindSafe for PendingBackgroundPids
impl Send for PendingBackgroundPids
impl Sync for PendingBackgroundPids
impl Unpin for PendingBackgroundPids
impl UnsafeUnpin for PendingBackgroundPids
impl UnwindSafe for PendingBackgroundPids
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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