pub trait TaskStore: Send + Sync {
Show 17 methods
// Required methods
fn open_session<'a>(
&'a self,
scope: &'a Scope,
queue: &'a str,
concurrency: u32,
) -> ContractFuture<'a, WorkerSession>;
fn extend_session<'a>(
&'a self,
worker_session_id: &'a str,
) -> ContractFuture<'a, WorkerSession>;
fn lookup_submission<'a>(
&'a self,
scope: &'a Scope,
idempotency_key: &'a str,
) -> ContractFuture<'a, Option<TaskSnapshot>>;
fn accept_resolved_submission<'a>(
&'a self,
command: &'a SubmitCommand,
descriptor: &'a ProgramDescriptor,
) -> ContractFuture<'a, TaskSnapshot>;
fn list_tasks<'a>(
&'a self,
scope: &'a Scope,
query: &'a TaskListQuery,
) -> ContractFuture<'a, TaskPage>;
fn status<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
) -> ContractFuture<'a, TaskStatus>;
fn result<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
) -> ContractFuture<'a, TaskResult>;
fn inspect<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
) -> ContractFuture<'a, TaskSnapshot>;
fn inspect_attempt<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
attempt_id: &'a str,
) -> ContractFuture<'a, AttemptSnapshot>;
fn history<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
after_sequence: u64,
) -> ContractFuture<'a, Vec<RecordedHistoryEvent>>;
fn probe_acquisition<'a>(
&'a self,
command: &'a AcquireCommand,
finish_empty: bool,
deadline: Instant,
) -> ContractFuture<'a, AcquisitionProbe>;
fn renew<'a>(
&'a self,
command: &'a RenewCommand,
) -> ContractFuture<'a, Authority>;
fn settle<'a>(
&'a self,
command: &'a SettleCommand,
) -> ContractFuture<'a, SettleReply>;
fn confirm_quiescence<'a>(
&'a self,
owner: &'a LeaseOwner,
) -> ContractFuture<'a, TaskState>;
fn cancel<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
) -> ContractFuture<'a, TaskState>;
// Provided methods
fn claim_dispatch<'a>(
&'a self,
_command: &'a ClaimCommand,
) -> ContractFuture<'a, ClaimReply> { ... }
fn acquire<'a>(
&'a self,
command: &'a AcquireCommand,
) -> ContractFuture<'a, AcquireReply> { ... }
}Expand description
Persistence boundary for complete single-task lifecycle operations.
Adapters load related records consistently, invoke the lifecycle core under the required locks, and atomically persist its complete transition. These operations must not perform external program resolution inside transactions.
Required Methods§
fn open_session<'a>( &'a self, scope: &'a Scope, queue: &'a str, concurrency: u32, ) -> ContractFuture<'a, WorkerSession>
fn extend_session<'a>( &'a self, worker_session_id: &'a str, ) -> ContractFuture<'a, WorkerSession>
Sourcefn lookup_submission<'a>(
&'a self,
scope: &'a Scope,
idempotency_key: &'a str,
) -> ContractFuture<'a, Option<TaskSnapshot>>
fn lookup_submission<'a>( &'a self, scope: &'a Scope, idempotency_key: &'a str, ) -> ContractFuture<'a, Option<TaskSnapshot>>
Read an already accepted submission before contacting the program store.
Sourcefn accept_resolved_submission<'a>(
&'a self,
command: &'a SubmitCommand,
descriptor: &'a ProgramDescriptor,
) -> ContractFuture<'a, TaskSnapshot>
fn accept_resolved_submission<'a>( &'a self, command: &'a SubmitCommand, descriptor: &'a ProgramDescriptor, ) -> ContractFuture<'a, TaskSnapshot>
Atomically accept this binding or replay the concurrently accepted winner.
Scoped submission-key uniqueness is authoritative. A matching winner’s input, descriptor, and origin context remain unchanged; different normalized input conflicts. The descriptor supplied by a losing caller must never replace the accepted one.
Sourcefn list_tasks<'a>(
&'a self,
scope: &'a Scope,
query: &'a TaskListQuery,
) -> ContractFuture<'a, TaskPage>
fn list_tasks<'a>( &'a self, scope: &'a Scope, query: &'a TaskListQuery, ) -> ContractFuture<'a, TaskPage>
Read one bounded page of matching committed task statuses in descending submission-time/task-ID order. Each page has its own read snapshot.
Sourcefn status<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
) -> ContractFuture<'a, TaskStatus>
fn status<'a>( &'a self, scope: &'a Scope, task_id: &'a str, ) -> ContractFuture<'a, TaskStatus>
Read compact scheduling metadata without application payloads.
Sourcefn result<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
) -> ContractFuture<'a, TaskResult>
fn result<'a>( &'a self, scope: &'a Scope, task_id: &'a str, ) -> ContractFuture<'a, TaskResult>
Read task metadata and its logical outcome from one consistent snapshot.
fn inspect<'a>( &'a self, scope: &'a Scope, task_id: &'a str, ) -> ContractFuture<'a, TaskSnapshot>
fn inspect_attempt<'a>( &'a self, scope: &'a Scope, task_id: &'a str, attempt_id: &'a str, ) -> ContractFuture<'a, AttemptSnapshot>
Sourcefn history<'a>(
&'a self,
scope: &'a Scope,
task_id: &'a str,
after_sequence: u64,
) -> ContractFuture<'a, Vec<RecordedHistoryEvent>>
fn history<'a>( &'a self, scope: &'a Scope, task_id: &'a str, after_sequence: u64, ) -> ContractFuture<'a, Vec<RecordedHistoryEvent>>
Read at most 100 ordered history records after the supplied sequence.
Sourcefn probe_acquisition<'a>(
&'a self,
command: &'a AcquireCommand,
finish_empty: bool,
deadline: Instant,
) -> ContractFuture<'a, AcquisitionProbe>
fn probe_acquisition<'a>( &'a self, command: &'a AcquireCommand, finish_empty: bool, deadline: Instant, ) -> ContractFuture<'a, AcquisitionProbe>
Probe under short atomic storage locks. Pending must roll back every mutation and release its connection before returning. The deadline bounds connection admission, contention, retries and commit acknowledgement.
fn renew<'a>( &'a self, command: &'a RenewCommand, ) -> ContractFuture<'a, Authority>
fn settle<'a>( &'a self, command: &'a SettleCommand, ) -> ContractFuture<'a, SettleReply>
fn confirm_quiescence<'a>( &'a self, owner: &'a LeaseOwner, ) -> ContractFuture<'a, TaskState>
fn cancel<'a>( &'a self, scope: &'a Scope, task_id: &'a str, ) -> ContractFuture<'a, TaskState>
Provided Methods§
Sourcefn claim_dispatch<'a>(
&'a self,
_command: &'a ClaimCommand,
) -> ContractFuture<'a, ClaimReply>
fn claim_dispatch<'a>( &'a self, _command: &'a ClaimCommand, ) -> ContractFuture<'a, ClaimReply>
Claim one exact external dispatch. Successful replies follow durable acceptance and bind the complete command. Unsupported implementations reject explicitly; they must never fall back to an unrestricted queue scan.
Sourcefn acquire<'a>(
&'a self,
command: &'a AcquireCommand,
) -> ContractFuture<'a, AcquireReply>
fn acquire<'a>( &'a self, command: &'a AcquireCommand, ) -> ContractFuture<'a, AcquireReply>
Immediate completion convenience for storage consumers and adapter tests.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".