Trait channel_loader::task::TaskHandler [−][src]
pub trait TaskHandler: Default + Send + Sync { type Key: Key; type Value: Send + Clone + 'static; type Error: Send + Clone + 'static; const MAX_BATCH_SIZE: i32; #[must_use] fn handle_task<'async_trait>(
task: Task<PendingAssignment<Self>>
) -> Pin<Box<dyn Future<Output = Task<CompletionReceipt<Self>>> + Send + 'async_trait>>
where
Self: 'async_trait; }
Expand description
A type-state control flow for driving tasks from assignment to completion. As task assignment can be deferred until connection acquisition and likewise loads batched by key, this enables opportunistic batching when connection acquisition becomes a bottleneck and also enables connection yielding as a consequence of work consolidation
Associated Types
Associated Constants
const MAX_BATCH_SIZE: i32
[src]Required methods
#[must_use]fn handle_task<'async_trait>(
task: Task<PendingAssignment<Self>>
) -> Pin<Box<dyn Future<Output = Task<CompletionReceipt<Self>>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]Implementors
type Error = SimpleDieselError
fn handle_task<'async_trait>(
task: Task<PendingAssignment<Self>>
) -> Pin<Box<dyn Future<Output = Task<CompletionReceipt<Self>>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]