ora_server

Trait Storage

Source
pub trait Storage:
    Send
    + Sync
    + 'static
    + Clone {
Show 27 methods // Required methods fn job_types_added<'life0, 'async_trait>( &'life0 self, job_types: Vec<JobType>, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn jobs_added<'life0, 'async_trait>( &'life0 self, jobs: Vec<NewJob>, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn jobs_cancelled<'life0, 'life1, 'async_trait>( &'life0 self, job_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledJob>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn executions_added<'life0, 'async_trait>( &'life0 self, executions: Vec<NewExecution>, timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn executions_ready<'life0, 'life1, 'async_trait>( &'life0 self, execution_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn execution_assigned<'life0, 'async_trait>( &'life0 self, execution_id: Uuid, executor_id: Uuid, timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn execution_started<'life0, 'async_trait>( &'life0 self, execution_id: Uuid, timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn execution_succeeded<'life0, 'async_trait>( &'life0 self, execution_id: Uuid, timestamp: SystemTime, output_payload_json: String, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn executions_failed<'life0, 'life1, 'async_trait>( &'life0 self, execution_ids: &'life1 [Uuid], timestamp: SystemTime, reason: String, mark_job_unschedulable: bool, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn orphan_execution_ids<'life0, 'life1, 'async_trait>( &'life0 self, executor_ids: &'life1 [Uuid], ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn jobs_unschedulable<'life0, 'life1, 'async_trait>( &'life0 self, job_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn pending_executions<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PendingExecution>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn ready_executions<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ReadyExecution>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn pending_jobs<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PendingJob>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn query_jobs<'life0, 'async_trait>( &'life0 self, cursor: Option<String>, limit: usize, order: JobQueryOrder, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<JobQueryResult, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn query_job_ids<'life0, 'async_trait>( &'life0 self, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn count_jobs<'life0, 'async_trait>( &'life0 self, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<u64, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn query_job_types<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<JobType>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_jobs<'life0, 'async_trait>( &'life0 self, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn schedules_added<'life0, 'async_trait>( &'life0 self, schedules: Vec<NewSchedule>, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn schedules_cancelled<'life0, 'life1, 'async_trait>( &'life0 self, schedule_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledSchedule>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn schedules_unschedulable<'life0, 'life1, 'async_trait>( &'life0 self, schedule_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn pending_schedules<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PendingSchedule>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn query_schedules<'life0, 'async_trait>( &'life0 self, cursor: Option<String>, limit: usize, filters: ScheduleQueryFilters, order: ScheduleQueryOrder, ) -> Pin<Box<dyn Future<Output = Result<ScheduleQueryResult, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn query_schedule_ids<'life0, 'async_trait>( &'life0 self, filters: ScheduleQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn count_schedules<'life0, 'async_trait>( &'life0 self, filters: ScheduleQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<u64, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_schedules<'life0, 'async_trait>( &'life0 self, filters: ScheduleQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait;
}
Expand description

An interface for storing and querying job and schedule data used by the Ora server.

Required Methods§

Source

fn job_types_added<'life0, 'async_trait>( &'life0 self, job_types: Vec<JobType>, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Add or update a job type.

Source

fn jobs_added<'life0, 'async_trait>( &'life0 self, jobs: Vec<NewJob>, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Persist the given new jobs.

Source

fn jobs_cancelled<'life0, 'life1, 'async_trait>( &'life0 self, job_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledJob>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Cancel the given jobs.

  • Mark the job as cancelled.
  • Mark the job as unschedulable.

Returns the cancelled jobs with their active executions, if any.

Source

fn executions_added<'life0, 'async_trait>( &'life0 self, executions: Vec<NewExecution>, timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Add new executions.

Source

fn executions_ready<'life0, 'life1, 'async_trait>( &'life0 self, execution_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

An execution is ready to be executed.

Source

fn execution_assigned<'life0, 'async_trait>( &'life0 self, execution_id: Uuid, executor_id: Uuid, timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

An execution was assigned to an executor.

Source

fn execution_started<'life0, 'async_trait>( &'life0 self, execution_id: Uuid, timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Set an execution as started.

Source

fn execution_succeeded<'life0, 'async_trait>( &'life0 self, execution_id: Uuid, timestamp: SystemTime, output_payload_json: String, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Set an execution as succeeded.

Source

fn executions_failed<'life0, 'life1, 'async_trait>( &'life0 self, execution_ids: &'life1 [Uuid], timestamp: SystemTime, reason: String, mark_job_unschedulable: bool, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Set an execution as failed, if mark_job_unschedulable is false the job is not marked as unschedulable, this happens when the job is retried.

Source

fn orphan_execution_ids<'life0, 'life1, 'async_trait>( &'life0 self, executor_ids: &'life1 [Uuid], ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Return assigned executions that are not assigned to any of the given executor IDs.

Source

fn jobs_unschedulable<'life0, 'life1, 'async_trait>( &'life0 self, job_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Mark a job as unschedulable.

No more executions will be created for the jobs and the given IDs must not be returned by the pending_jobs method. However existing executions are not affected.

Source

fn pending_executions<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PendingExecution>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Executions that are not yet ready to be executed.

The returned values must be in ascending order, an optional after parameter can be used to filter out values that were created before the given UUID.

If the after parameter is given, the stream must not include the execution with the given UUID and any IDs that are smaller.

The implementation may choose to return a limited number of executions in a single call in order to avoid resource exhaustion.

Source

fn ready_executions<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ReadyExecution>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Unassigned executions that are ready at the time of the call.

The returned values must be in ascending order, an optional after parameter can be used to filter out values that were created before the given UUID.

The returned executions must be ordered by their ID in ascending order.

The implementation may choose to return a limited number of executions in a single call in order to avoid resource exhaustion.

Source

fn pending_jobs<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PendingJob>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Jobs that satisfy the following conditions:

  • have no executions in progress
  • are active

The returned values must be in ascending order, an optional after parameter can be used to filter out values that were created before the given UUID.

The implementation may choose to return a limited number of executions in a single call in order to avoid resource exhaustion.

Source

fn query_jobs<'life0, 'async_trait>( &'life0 self, cursor: Option<String>, limit: usize, order: JobQueryOrder, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<JobQueryResult, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Query and return a list of jobs with the given parameters.

A next token can be provided to continue the query from the last result.

Source

fn query_job_ids<'life0, 'async_trait>( &'life0 self, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Query and return a list of job IDs with the given parameters.

Source

fn count_jobs<'life0, 'async_trait>( &'life0 self, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<u64, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Count the number of jobs that satisfy the given filters.

Source

fn query_job_types<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<JobType>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Query and return a list of job types with the given parameters.

Source

fn delete_jobs<'life0, 'async_trait>( &'life0 self, filters: JobQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Remove jobs and all related data, returns the removed job IDs.

This should also remove all executions created by the jobs.

Source

fn schedules_added<'life0, 'async_trait>( &'life0 self, schedules: Vec<NewSchedule>, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Persist the given new schedules.

Source

fn schedules_cancelled<'life0, 'life1, 'async_trait>( &'life0 self, schedule_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<Vec<CancelledSchedule>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Cancel the given schedules.

  • Mark the schedule as cancelled.
  • Mark the schedule as unschedulable.

Returns the cancelled schedules.

Source

fn schedules_unschedulable<'life0, 'life1, 'async_trait>( &'life0 self, schedule_ids: &'life1 [Uuid], timestamp: SystemTime, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Mark the given schedules as unschedulable.

Source

fn pending_schedules<'life0, 'async_trait>( &'life0 self, after: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PendingSchedule>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Return all pending schedules.

A pending schedule is a schedule that satisfies all the following conditions:

  • is active
  • has not been cancelled
  • has no active jobs

The returned values must be in ascending order, an optional after parameter can be used to filter out values that were created before the given UUID.

The implementation may choose to return a limited number of executions in a single call in order to avoid resource exhaustion.

Source

fn query_schedules<'life0, 'async_trait>( &'life0 self, cursor: Option<String>, limit: usize, filters: ScheduleQueryFilters, order: ScheduleQueryOrder, ) -> Pin<Box<dyn Future<Output = Result<ScheduleQueryResult, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Query and return a list of schedules with the given parameters.

A next token can be provided to continue the query from the last result.

Source

fn query_schedule_ids<'life0, 'async_trait>( &'life0 self, filters: ScheduleQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Query and return a list of schedule IDs with the given parameters.

Source

fn count_schedules<'life0, 'async_trait>( &'life0 self, filters: ScheduleQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<u64, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Count the number of schedules that satisfy the given filters.

Source

fn delete_schedules<'life0, 'async_trait>( &'life0 self, filters: ScheduleQueryFilters, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Remove schedules and all related data, returns the removed schedule IDs.

This should also remove all jobs created by the schedules.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§