Skip to main content

TaskQueue

Trait TaskQueue 

Source
pub trait TaskQueue<Data>
where Data: Debug + Clone + Serialize + DeserializeOwned + Send + Sync + 'static,
{ // Required methods fn push<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task<Data>, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn pop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Task<Data>, TaskQueueError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn ack<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 TaskId, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn nack<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task<Data>, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn set<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task<Data>, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided method fn recover_inflight<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, TaskQueueError>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } }

Required Methods§

Source

fn push<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task<Data>, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn pop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Task<Data>, TaskQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn ack<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 TaskId, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn nack<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task<Data>, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn set<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 Task<Data>, ) -> Pin<Box<dyn Future<Output = Result<(), TaskQueueError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn recover_inflight<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, TaskQueueError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Move any tasks left in the in-flight set back to the queue. Called once at runtime startup to recover work owned by a previous process that crashed before acking. Returns the number of tasks recovered.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D, S> TaskQueue<D> for FjallRoundRobinTaskQueue<D, S>

Source§

impl<D, S> TaskQueue<D> for FjallTaskQueue<D, S>
where D: Debug + Clone + Serialize + DeserializeOwned + Send + Sync + 'static, S: TaskSerializer + Send + Sync,

Source§

impl<D, S> TaskQueue<D> for InMemoryTaskQueue<D, S>
where D: Debug + Clone + Serialize + DeserializeOwned + Send + Sync + 'static, S: TaskSerializer + Send + Sync,