pub struct AgentReadinessProbe(/* private fields */);Expand description
In-process agent-loop readiness probe.
Agent-loop serviceability (“can this daemon serve a chat turn?”) is global
daemon health, not per-principal authorization — so the co-located gateway’s
prompt fail-fast reads it directly instead of issuing the capability-gated
crate::kernel_api::KernelRequest::GetAgentReadiness as the caller (which
only admins/capsule:list holders could answer). The closure is built in
astrid-kernel (which owns the live registry) and merely invoked by the
gateway, so neither the capability model nor the gateway’s dependency on the
WASM engine is touched. Defined here so both crates can name it without a
dependency cycle, and spelled with std types so astrid-core needs no
futures dependency.
Implementations§
Source§impl AgentReadinessProbe
impl AgentReadinessProbe
Sourcepub fn new(
f: impl Fn() -> Pin<Box<dyn Future<Output = AgentLoopReadiness> + Send>> + Send + Sync + 'static,
) -> Self
pub fn new( f: impl Fn() -> Pin<Box<dyn Future<Output = AgentLoopReadiness> + Send>> + Send + Sync + 'static, ) -> Self
Wrap a readiness-computing closure. The closure must be cheap and self-contained (it captures whatever state it reads) so each call reflects the current loaded set.
Sourcepub async fn probe(&self) -> AgentLoopReadiness
pub async fn probe(&self) -> AgentLoopReadiness
Compute current readiness.
Trait Implementations§
Source§impl Clone for AgentReadinessProbe
impl Clone for AgentReadinessProbe
Source§fn clone(&self) -> AgentReadinessProbe
fn clone(&self) -> AgentReadinessProbe
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more