pub struct DaemonExecutor { /* private fields */ }Expand description
Per-HookConfig long-lived child. One executor owns one child
at a time; fires are serialized through a single connection
mutex (NDJSON request → NDJSON response). On framing error or
child exit, the connection is dropped and the next fire
reconnects with exponential backoff.
Implementations§
Source§impl DaemonExecutor
impl DaemonExecutor
pub fn new(config: HookConfig) -> Self
Trait Implementations§
Source§impl Drop for DaemonExecutor
impl Drop for DaemonExecutor
Source§impl HookExecutor for DaemonExecutor
impl HookExecutor for DaemonExecutor
Source§fn fire<'a>(
&'a self,
event: HookEvent,
payload: Value,
) -> Pin<Box<dyn Future<Output = Result<HookDecision>> + Send + 'a>>
fn fire<'a>( &'a self, event: HookEvent, payload: Value, ) -> Pin<Box<dyn Future<Output = Result<HookDecision>> + Send + 'a>>
Fire the hook for
event with payload. Returns the
child’s HookDecision or an ExecutorError on
spawn / IO / decode / timeout failure. Read moreSource§fn metrics(&self) -> ExecutorMetrics
fn metrics(&self) -> ExecutorMetrics
Snapshot of executor metrics. Surfaced by
ai-memory doctor --tokens --hooks (see src/cli/doctor.rs).Auto Trait Implementations§
impl !Freeze for DaemonExecutor
impl !RefUnwindSafe for DaemonExecutor
impl !UnwindSafe for DaemonExecutor
impl Send for DaemonExecutor
impl Sync for DaemonExecutor
impl Unpin for DaemonExecutor
impl UnsafeUnpin for DaemonExecutor
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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