pub struct AgentTaskStore {
pool: SqlitePool,
workspace_id: String,
}Fields§
§pool: SqlitePool§workspace_id: StringImplementations§
Source§impl AgentTaskStore
impl AgentTaskStore
pub fn new(pool: SqlitePool, workspace_id: &str) -> Result<Self>
pub(crate) fn run_store(&self) -> Result<AgentRunStore>
pub async fn submit( &self, submission: AgentTaskSubmission, ) -> Result<AgentTaskSubmissionResult>
pub async fn get(&self, id: &str) -> Result<Option<AgentTask>>
Sourcepub async fn inspect(&self, id: &str) -> Result<Option<AgentTaskInspection>>
pub async fn inspect(&self, id: &str) -> Result<Option<AgentTaskInspection>>
Inspect scheduling state without copying execution state into the task.
Sourcepub async fn list_inspections(
&self,
limit: u32,
) -> Result<Vec<AgentTaskInspection>>
pub async fn list_inspections( &self, limit: u32, ) -> Result<Vec<AgentTaskInspection>>
List bounded scheduling records with authoritative linked run projections.
pub async fn list(&self, limit: u32) -> Result<Vec<AgentTask>>
pub async fn events( &self, id: &str, after_sequence: i64, limit: u32, ) -> Result<Vec<AgentTaskEvent>>
Sourcepub async fn claim_next(
&self,
worker_id: &str,
lease_seconds: u64,
max_attempts: u32,
) -> Result<Option<AgentTaskClaim>>
pub async fn claim_next( &self, worker_id: &str, lease_seconds: u64, max_attempts: u32, ) -> Result<Option<AgentTaskClaim>>
Claim the oldest queued task using the database clock for its lease.
Sourcepub async fn claim_next_expired(
&self,
worker_id: &str,
lease_seconds: u64,
) -> Result<Option<ExpiredAgentTaskClaim>>
pub async fn claim_next_expired( &self, worker_id: &str, lease_seconds: u64, ) -> Result<Option<ExpiredAgentTaskClaim>>
Take scheduling ownership of the oldest expired claim for reconciliation.
Sourcepub async fn heartbeat(
&self,
claim: &AgentTaskClaim,
lease_seconds: u64,
) -> Result<AgentTask>
pub async fn heartbeat( &self, claim: &AgentTaskClaim, lease_seconds: u64, ) -> Result<AgentTask>
Extend an owned claim from the database’s current time.
Sourcepub async fn link_run(
&self,
claim: &AgentTaskClaim,
agent_version: &str,
model: &str,
budgets: RunBudgets,
) -> Result<AgentRun>
pub async fn link_run( &self, claim: &AgentTaskClaim, agent_version: &str, model: &str, budgets: RunBudgets, ) -> Result<AgentRun>
Atomically create the task’s sole root run and persist its immutable link.
pub async fn finish_identity_changed( &self, claim: &AgentTaskClaim, ) -> Result<AgentTask>
pub async fn finish_run_stopped( &self, claim: &AgentTaskClaim, ) -> Result<AgentTask>
pub async fn finish_cancelled_before_run( &self, claim: &AgentTaskClaim, ) -> Result<AgentTask>
pub async fn finish_claim_attempts_exhausted( &self, claim: &AgentTaskClaim, ) -> Result<AgentTask>
pub async fn finish_restart_required( &self, claim: &AgentTaskClaim, ) -> Result<AgentTask>
pub async fn finish_reconciliation_required( &self, claim: &AgentTaskClaim, ) -> Result<AgentTask>
Sourcepub async fn requeue(&self, claim: &AgentTaskClaim) -> Result<AgentTask>
pub async fn requeue(&self, claim: &AgentTaskClaim) -> Result<AgentTask>
Return an expired pre-run claim to the queue without changing attempts.
pub(crate) async fn fail_linked_run_setup( &self, claim: &AgentTaskClaim, run_id: &str, ) -> Result<AgentTask>
async fn finish_claim( &self, claim: &AgentTaskClaim, reason: &str, require_run: bool, ) -> Result<AgentTask>
Sourcepub async fn cancel(&self, id: &str) -> Result<AgentTask>
pub async fn cancel(&self, id: &str) -> Result<AgentTask>
Request cancellation without rewriting linked run state.
Sourcepub async fn cancel_queued(&self, id: &str) -> Result<AgentTask>
pub async fn cancel_queued(&self, id: &str) -> Result<AgentTask>
Backward-compatible queued-only cancellation surface.
Trait Implementations§
Source§impl Clone for AgentTaskStore
impl Clone for AgentTaskStore
Source§fn clone(&self) -> AgentTaskStore
fn clone(&self) -> AgentTaskStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AgentTaskStore
impl !UnwindSafe for AgentTaskStore
impl Freeze for AgentTaskStore
impl Send for AgentTaskStore
impl Sync for AgentTaskStore
impl Unpin for AgentTaskStore
impl UnsafeUnpin for AgentTaskStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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