pub struct InMemorySchedulerStore { /* private fields */ }Expand description
Thread-safe in-memory persistence for jobs, runs, and coordinator metadata.
Process-local and non-durable — suitable for Mode 1 embedded experiments, unit tests, examples, and benchmarks. Do not share across processes; use SQLite or Postgres for durable / Mode 2 topologies.
Enable the facade mem feature to re-export this type from chronon. Wire with
ChrononBuilder::scheduler_store(Arc::new(InMemorySchedulerStore::new())) or
crate::install_default_mem_store.
§Examples
use std::sync::Arc;
use chronon_backend_mem::InMemorySchedulerStore;
use chronon_core::{Job, SchedulerStore};
let store = Arc::new(InMemorySchedulerStore::new());
store.upsert_job(&Job::new("demo", "noop")).await?;
assert_eq!(store.list_jobs().await?.len(), 1);Implementations§
Source§impl InMemorySchedulerStore
impl InMemorySchedulerStore
Sourcepub fn new() -> InMemorySchedulerStore
pub fn new() -> InMemorySchedulerStore
Creates an empty store.
§Examples
use chronon_backend_mem::InMemorySchedulerStore;
use chronon_core::SchedulerStore;
let store = InMemorySchedulerStore::new();
assert!(store.list_jobs().await.unwrap().is_empty());Trait Implementations§
Source§impl Default for InMemorySchedulerStore
impl Default for InMemorySchedulerStore
Source§fn default() -> InMemorySchedulerStore
fn default() -> InMemorySchedulerStore
Returns the “default value” for a type. Read more
Source§impl SchedulerStore for InMemorySchedulerStore
impl SchedulerStore for InMemorySchedulerStore
Source§fn upsert_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job: &'life1 Job,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn upsert_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job: &'life1 Job,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Insert or replace a job row keyed by
Job::job_id. Read moreSource§fn get_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn get_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Look up a job by primary key.
Source§fn get_job_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
job_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn get_job_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
job_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Look up a job by unique
Job::job_name.Source§fn list_jobs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn list_jobs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Return all jobs (admin / list API).
Source§fn list_due_jobs<'life0, 'async_trait>(
&'life0 self,
before: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn list_due_jobs<'life0, 'async_trait>(
&'life0 self,
before: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Job>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Jobs with
next_run_at <= before and enabled scheduling (tick discovery). Read moreSource§fn pause_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn pause_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Disable automatic scheduling without deleting the job.
Source§fn resume_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn resume_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Re-enable automatic scheduling after
Self::pause_job.Source§fn create_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run: &'life1 Run,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn create_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run: &'life1 Run,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Persist a new run row (typically
RunStatus::Queued). Read moreSource§fn update_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run: &'life1 Run,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn update_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run: &'life1 Run,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Replace an existing run row (status transitions, lease renewal, completion).
Source§fn get_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn get_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Look up a run by
Run::run_id.Source§fn list_runs_for_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn list_runs_for_job<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Recent runs for one job, newest first, capped by
limit.Source§fn list_runs_filtered<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: Option<&'life1 str>,
status: Option<RunStatus>,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn list_runs_filtered<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: Option<&'life1 str>,
status: Option<RunStatus>,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Paginated run listing with optional job and status filters (HTTP list API).
Source§fn claim_next_queued<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
pool_id: &'life1 str,
worker_id: &'life2 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn claim_next_queued<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
pool_id: &'life1 str,
worker_id: &'life2 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Claim the next queued run for a worker pool. Read more
Source§fn claim_run_by_id<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
pool_id: &'life2 str,
worker_id: &'life3 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn claim_run_by_id<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
pool_id: &'life2 str,
worker_id: &'life3 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Claim a specific queued run by id (postgres-redis hybrid hot path). Read more
Source§fn renew_run_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
worker_id: &'life2 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn renew_run_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
worker_id: &'life2 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Extend the worker lease on a claimed run if
worker_id still holds the claim. Read moreSource§fn append_revision<'life0, 'life1, 'async_trait>(
&'life0 self,
revision: &'life1 JobRevision,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn append_revision<'life0, 'life1, 'async_trait>(
&'life0 self,
revision: &'life1 JobRevision,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Append an immutable job revision snapshot (audit / rollback).
Source§fn list_revisions<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<JobRevision>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn list_revisions<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<JobRevision>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
All revisions for a job, typically oldest-first.
Source§fn upsert_script<'life0, 'life1, 'async_trait>(
&'life0 self,
script: &'life1 Script,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn upsert_script<'life0, 'life1, 'async_trait>(
&'life0 self,
script: &'life1 Script,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Insert or replace script metadata (name, signature hash).
Source§fn get_script<'life0, 'life1, 'async_trait>(
&'life0 self,
script_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Script>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn get_script<'life0, 'life1, 'async_trait>(
&'life0 self,
script_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Script>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Look up persisted script metadata by name.
Source§fn try_claim_run_once<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
claimed_by: &'life2 str,
now: DateTime<Utc>,
claim_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn try_claim_run_once<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
claimed_by: &'life2 str,
now: DateTime<Utc>,
claim_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Attempt exclusive claim for a run-once job before enqueueing its single run. Read more
Source§fn mark_run_once_completed<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
completed_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn mark_run_once_completed<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
completed_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Mark a run-once job as finished so future ticks skip it.
Source§fn release_run_once_claim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
claimed_by: &'life2 str,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn release_run_once_claim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
claimed_by: &'life2 str,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Release a run-once claim when enqueue failed or the coordinator shut down cleanly.
Source§fn find_due_job_ids_in_partitions<'life0, 'life1, 'async_trait>(
&'life0 self,
owned_partitions: &'life1 [u32],
due_until: DateTime<Utc>,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn find_due_job_ids_in_partitions<'life0, 'life1, 'async_trait>(
&'life0 self,
owned_partitions: &'life1 [u32],
due_until: DateTime<Utc>,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Due job ids owned by this coordinator’s partition slice (distributed tick).
Source§fn min_next_run_at_in_partitions<'life0, 'life1, 'async_trait>(
&'life0 self,
owned_partitions: &'life1 [u32],
) -> Pin<Box<dyn Future<Output = Result<Option<DateTime<Utc>>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn min_next_run_at_in_partitions<'life0, 'life1, 'async_trait>(
&'life0 self,
owned_partitions: &'life1 [u32],
) -> Pin<Box<dyn Future<Output = Result<Option<DateTime<Utc>>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Earliest
next_run_at among jobs in the owned partitions (sleep hint for tick loop).Source§fn claim_job_for_tick<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
claim_id: &'life2 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn claim_job_for_tick<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
claim_id: &'life2 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Exclusive short-lived lease on a job row during tick processing. Read more
Source§fn release_job_tick_claim<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn release_job_tick_claim<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Release tick claim after enqueue succeeds or the tick aborts.
Source§fn persist_post_tick_job_state<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
next_run_at: Option<DateTime<Utc>>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn persist_post_tick_job_state<'life0, 'life1, 'async_trait>(
&'life0 self,
job_id: &'life1 str,
next_run_at: Option<DateTime<Utc>>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Persist
next_run_at (and related job fields) after a successful tick.Source§fn try_acquire_leader<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn try_acquire_leader<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<bool, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Attempt to become the active scheduler leader (singleton row + TTL).
Source§fn renew_leader_lease<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn renew_leader_lease<'life0, 'life1, 'async_trait>(
&'life0 self,
instance_id: &'life1 str,
ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Renew the leader lease while this instance remains leader.
Source§fn get_leader<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SchedulerLeader>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn get_leader<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SchedulerLeader>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Current leader row, if any (expired leases may still be returned for diagnostics).
Source§fn upsert_partition_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
assignment: &'life1 PartitionAssignment,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn upsert_partition_assignment<'life0, 'life1, 'async_trait>(
&'life0 self,
assignment: &'life1 PartitionAssignment,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Upsert partition ownership for coordinator sharding.
Source§fn list_partition_assignments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignment>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn list_partition_assignments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PartitionAssignment>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemorySchedulerStore: 'async_trait,
All partition assignments (rebalance / diagnostics).
Source§fn register_worker<'life0, 'life1, 'async_trait>(
&'life0 self,
worker: &'life1 Worker,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn register_worker<'life0, 'life1, 'async_trait>(
&'life0 self,
worker: &'life1 Worker,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Register or update a worker heartbeat row.
Source§fn heartbeat_worker<'life0, 'life1, 'async_trait>(
&'life0 self,
worker_id: &'life1 str,
at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
fn heartbeat_worker<'life0, 'life1, 'async_trait>(
&'life0 self,
worker_id: &'life1 str,
at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemorySchedulerStore: 'async_trait,
Update
last_heartbeat_at for an existing worker.Source§fn claim_runs_by_ids<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
run_ids: &'life1 [&'life2 str],
pool_id: &'life3 str,
worker_id: &'life4 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn claim_runs_by_ids<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
run_ids: &'life1 [&'life2 str],
pool_id: &'life3 str,
worker_id: &'life4 str,
now: DateTime<Utc>,
lease_ttl_secs: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Run>, ChrononError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Claim multiple queued runs by id in one round trip when the backend supports it. Read more
Auto Trait Implementations§
impl !Freeze for InMemorySchedulerStore
impl RefUnwindSafe for InMemorySchedulerStore
impl Send for InMemorySchedulerStore
impl Sync for InMemorySchedulerStore
impl Unpin for InMemorySchedulerStore
impl UnsafeUnpin for InMemorySchedulerStore
impl UnwindSafe for InMemorySchedulerStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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