mutant_lib/ops/worker/
async_task.rs1use std::fmt::Debug;
2
3#[async_trait::async_trait]
4pub trait AsyncTask<Item, Context, Client, TaskResult, TaskError>: Send + Sync + 'static
5where
6 Item: Send + 'static,
7 Context: Send + Sync + 'static,
8 Client: Send + Sync + 'static,
9 TaskResult: Send + 'static,
10 TaskError: Debug + Send + 'static,
11{
12 type ItemId: Send + Debug + Clone;
13
14 async fn process(
15 &self,
16 worker_id: usize,
17 client: &Client,
18 item: Item,
19 ) -> Result<(Self::ItemId, TaskResult), (TaskError, Item)>;
20}