Trait BackendExpose

Source
pub trait BackendExpose<T>
where Self: Sized,
{ type Request; type Error; // Required methods fn list_workers( &self, ) -> impl Future<Output = Result<Vec<Worker<WorkerState>>, Self::Error>> + Send; fn stats(&self) -> impl Future<Output = Result<Stat, Self::Error>> + Send; fn list_jobs( &self, status: &State, page: i32, ) -> impl Future<Output = Result<Vec<Self::Request>, Self::Error>> + Send; }
Expand description

Represents functionality that allows reading of jobs and stats from a backend Some backends esp MessageQueues may not currently implement this

Required Associated Types§

Source

type Request

The request type being handled by the backend

Source

type Error

The error returned during reading jobs and stats

Required Methods§

Source

fn list_workers( &self, ) -> impl Future<Output = Result<Vec<Worker<WorkerState>>, Self::Error>> + Send

List all Workers that are working on a backend

Source

fn stats(&self) -> impl Future<Output = Result<Stat, Self::Error>> + Send

Returns the counts of jobs in different states

Source

fn list_jobs( &self, status: &State, page: i32, ) -> impl Future<Output = Result<Vec<Self::Request>, Self::Error>> + Send

Fetch jobs persisted in a backend

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§