Skip to content

Commit 5c1e43c

Browse files
committed
feat: added queue name struct
1 parent c4ed643 commit 5c1e43c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/flow_queue/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pub mod connection;
2-
pub mod service;
2+
pub mod name;
3+
pub mod handler;
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
use std::ops::Add;
22

3+
pub struct QueueName {
4+
pub prefix: QueuePrefix,
5+
pub protocol: QueueProtocol,
6+
}
7+
38
/// # Queue Prefix
49
/// - Every incoming message will have the `Send` prefix
510
/// - Every processed message (answer) from taurus will have the `Receive` prefix
@@ -16,12 +21,11 @@ pub enum QueueProtocol {
1621

1722
/// Implementation to turn a protocol into a str
1823
impl QueueProtocol {
19-
2024
/// Function to turn a protocol into a str
2125
///
2226
/// # Example:
2327
/// ```
24-
/// use code0_flow::flow_queue::service::QueueProtocol;
28+
/// use code0_flow::flow_queue::name::QueueProtocol;
2529
/// let proto_str = QueueProtocol::Rest.as_str().to_string();
2630
/// let result = "REST".to_string();
2731
///
@@ -43,7 +47,7 @@ impl Add<QueueProtocol> for QueuePrefix {
4347
///
4448
/// # Example:
4549
/// ```
46-
/// use code0_flow::flow_queue::service::{QueuePrefix, QueueProtocol};
50+
/// use code0_flow::flow_queue::name::{QueuePrefix, QueueProtocol};
4751
/// let send_rest_queue_name = QueuePrefix::Send + QueueProtocol::Rest;
4852
/// let result = "S_REST".to_string();
4953
///
@@ -55,4 +59,4 @@ impl Add<QueueProtocol> for QueuePrefix {
5559
QueuePrefix::Receive => "R_".to_string() + rhs.as_str(),
5660
}
5761
}
58-
}
62+
}

0 commit comments

Comments
 (0)