Skip to main content

Crate troupekit_host

Crate troupekit_host 

Source
Expand description

Hosting for Troupekit graph runs: a job queue with one leased job per run, an event log that dedupes on (run_id, seq), and a Runner that claims a job, steps the run from its latest checkpoint and saves it, in worker mode (a loop) or step mode (one tick per serverless request).

Re-exports§

pub use error::HostError;
pub use events::EventLog;
pub use queue::InMemQueue;
pub use runner::Processed;
pub use runner::Runner;
pub use runner::TickOptions;
pub use runner::TickReport;
pub use runner::WorkOptions;

Modules§

error
events
queue
runner

Structs§

Lease
A claimed job: the run to step, the lease token that proves the claim and how many times the job was claimed since it last completed or was rescheduled. A token from an expired, re-claimed lease is stale.

Enums§

JobState
Where one run’s job stands. Pending waits for due_ms; Leased is held until until_ms, with next_due_ms from an enqueue during the lease; Done and Failed end it until the next enqueue.

Traits§

JobQueue
Jobs keyed by run, at most one live job per run. claim_due leases due jobs and expired leases, earliest first; complete, fail and reschedule end a lease and return CoreError::Conflict for a stale one.