1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use serde::{Deserialize, Serialize};
#[cfg(feature = "ext-producer")]
mod producer;
#[cfg(feature = "ext-producer")]
pub use producer::{dump_error_resp_env, BoxedFinalizeHook, BoxedPrepareHook, Producer, ProducerBuilder};
mod consumer;
pub use consumer::run as run_consumer;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Request<T> {
pub id: u64,
pub task: T,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Response<O> {
pub id: u64,
pub err_msg: Option<String>,
pub output: Option<O>,
}
#[inline]
fn ready_msg(name: &str) -> String {
format!("{} processor ready", name)
}