pub struct ExecExecutor { /* private fields */ }Expand description
Subprocess-per-fire executor. Spawns a fresh child for every
event; closes stdin to signal “no more input”; reads stdout to
EOF and parses a single HookDecision.
Cheapest mental model. Right pick for low-rate events. Hot
events should configure mode = "daemon" instead.
Implementations§
Source§impl ExecExecutor
impl ExecExecutor
pub fn new(config: HookConfig) -> Self
Trait Implementations§
Source§impl HookExecutor for ExecExecutor
impl HookExecutor for ExecExecutor
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 ExecExecutor
impl RefUnwindSafe for ExecExecutor
impl Send for ExecExecutor
impl Sync for ExecExecutor
impl Unpin for ExecExecutor
impl UnsafeUnpin for ExecExecutor
impl UnwindSafe for ExecExecutor
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