pub struct Finalizer { /* private fields */ }Expand description
Shared asynchronous finalization service.
Implementations§
Source§impl Finalizer
impl Finalizer
Sourcepub fn metrics(&self) -> &Arc<Registry>
pub fn metrics(&self) -> &Arc<Registry>
Access the shared metrics registry so background paths (stream abort, worker-side supervision) can bump counters without plumbing the registry through every struct field.
Sourcepub fn new(
signer: Arc<dyn Signer>,
spool_dir: PathBuf,
metrics: Arc<Registry>,
) -> Self
pub fn new( signer: Arc<dyn Signer>, spool_dir: PathBuf, metrics: Arc<Registry>, ) -> Self
Create a finalizer writing unsigned artifacts beneath spool_dir.
Sourcepub fn with_bridge(
signer: Arc<dyn Signer>,
spool_dir: PathBuf,
metrics: Arc<Registry>,
bridge: Arc<dyn EventBus>,
) -> Self
pub fn with_bridge( signer: Arc<dyn Signer>, spool_dir: PathBuf, metrics: Arc<Registry>, bridge: Arc<dyn EventBus>, ) -> Self
Create a finalizer that also emits receipt events to the Bridge.
Sourcepub fn with_state_store(self, store: Arc<dyn StateStore>) -> Self
pub fn with_state_store(self, store: Arc<dyn StateStore>) -> Self
Attach the quota/budget state store whose per-session counters are cleared when a session is sealed.
Sourcepub async fn close_session(
&self,
session: Arc<Session>,
stop_reason: StopReason,
) -> Result<FinalizeOutcome, FinalizeError>
pub async fn close_session( &self, session: Arc<Session>, stop_reason: StopReason, ) -> Result<FinalizeOutcome, FinalizeError>
Close exactly once. Receipt signing and ATIF serialization never run on the request hot path.
Sourcepub async fn promote(
&self,
session: Arc<Session>,
) -> Result<Receipt, FinalizeError>
pub async fn promote( &self, session: Arc<Session>, ) -> Result<Receipt, FinalizeError>
Promote a persisted unsigned trajectory into a retroactive Receipt.
Sourcepub async fn recover_spooled_sessions(
&self,
sessions: &SessionRegistry,
breaker: &BreakerConfig,
) -> Result<usize, FinalizeError>
pub async fn recover_spooled_sessions( &self, sessions: &SessionRegistry, breaker: &BreakerConfig, ) -> Result<usize, FinalizeError>
Recover interrupted sessions from the spool: quarantine sessions with incomplete effects, replay lifecycle outboxes, recover signed journal sessions, consolidate unsigned step journals, then scan strict ATIF artifacts for closed unsigned sessions. Returns the total count of recovered sessions (unsigned + signed).
Sourcepub async fn retry_marked_promotions(
&self,
sessions: &SessionRegistry,
) -> Result<usize, FinalizeError>
pub async fn retry_marked_promotions( &self, sessions: &SessionRegistry, ) -> Result<usize, FinalizeError>
Retry every durable promotion marker whose session can be recovered.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Finalizer
impl !RefUnwindSafe for Finalizer
impl Send for Finalizer
impl Sync for Finalizer
impl Unpin for Finalizer
impl UnsafeUnpin for Finalizer
impl !UnwindSafe for Finalizer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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