pub struct RoutineClient { /* private fields */ }Expand description
Client for a routine daemon rooted at one machine-local state directory.
request never starts a daemon. start ensures
a daemon is running without accessing a project. request_with_start
accepts routine list and mutation requests, probes daemon availability with
a status request, then starts the caller-provided command only when the daemon
is unavailable. Status and shutdown requests are rejected by the auto-start
boundary and must use request. The caller’s request is sent
exactly once. Availability probing and startup share the configured startup
timeout. The command must run a routine daemon that
writes ready or error:<message> to the descriptor supplied in the
ASCHED_STARTUP_FD environment variable. The client adds that
handshake and a detached process group; executable, arguments, standard
streams, and other environment are controlled by the caller.
Implementations§
Source§impl RoutineClient
impl RoutineClient
pub fn new(root: PathBuf) -> Self
Sourcepub fn with_startup_timeout(self, timeout: Duration) -> Self
pub fn with_startup_timeout(self, timeout: Duration) -> Self
Override the bounded startup timeout, primarily for hosts and tests.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Override the timeout for one request to an already-running daemon.
pub fn root(&self) -> &Path
pub fn socket_path(&self) -> PathBuf
pub fn fire( &self, project: &Path, kind: &str, payload: Value, event_id: &str, ) -> Result<FireOutcome, RoutineError>
Sourcepub fn request(&self, request: &Request) -> Result<Response, RoutineError>
pub fn request(&self, request: &Request) -> Result<Response, RoutineError>
Send to an already-running daemon without changing daemon lifecycle.
Sourcepub fn start(&self, command: Command) -> Result<(), RoutineError>
pub fn start(&self, command: Command) -> Result<(), RoutineError>
Ensure a daemon is running without issuing a project-scoped request.
Sourcepub fn request_with_start(
&self,
request: &Request,
command: Command,
) -> Result<Response, RoutineError>
pub fn request_with_start( &self, request: &Request, command: Command, ) -> Result<Response, RoutineError>
Send a request once, starting the daemon with command if it is unavailable.
Trait Implementations§
Source§impl Clone for RoutineClient
impl Clone for RoutineClient
Source§fn clone(&self) -> RoutineClient
fn clone(&self) -> RoutineClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more