msgq/
conf.rs

1use fred::types::Key;
2
3#[derive(Debug)]
4pub struct Conf {
5  pub stream: Key,
6  pub group: String,
7  pub consumer: String,
8  pub count: u64,
9  pub max_retry: u64,
10  pub block_ms: u64,
11  pub claim_idle_ms: u64,
12}
13
14impl Conf {
15  pub fn new(
16    stream: impl Into<Key>,
17    group: impl Into<String>,
18    consumer: impl Into<String>,
19    block_sec: u64,
20    claim_idle_sec: u64,
21    count: u64,
22    max_retry: u64,
23  ) -> Self {
24    Self {
25      stream: stream.into(),
26      group: group.into(),
27      consumer: consumer.into(),
28      count,
29      max_retry,
30      block_ms: block_sec * 1000,
31      claim_idle_ms: claim_idle_sec * 1000,
32    }
33  }
34}