Skip to content

Commit 6de2572

Browse files
Merge pull request #68 from code0-tech/59-drop-redis-and-rabbitmq
Drop Redis and RabbitMQ
2 parents ecf4302 + dd12e21 commit 6de2572

File tree

12 files changed

+323
-4313
lines changed

12 files changed

+323
-4313
lines changed

Cargo.lock

Lines changed: 289 additions & 2923 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,17 @@ tucana = { version = "0.0.32", features = ["aquila"] }
1212
tokio = "1.43.0"
1313
async-trait = "0.1.85"
1414
log = "0.4.24"
15-
redis = { version = "0.32.0", features = [
16-
"aio",
17-
"tokio-comp",
18-
"async-std-comp",
19-
"json",
20-
] }
2115
serde_json = "1.0.138"
2216
serde = "1.0.138"
23-
lapin = "3.0.0"
24-
futures-lite = "2.6.0"
2517
tonic = "0.13.0"
2618
dotenv = "0.15.0"
27-
28-
29-
[dev-dependencies]
30-
testcontainers = "0.25.0"
31-
serial_test = "3.2.0"
19+
code0-definition-reader = "0.0.8"
3220

3321
[lib]
3422
doctest = true
3523

3624
[features]
3725
default = ["all"]
38-
flow_queue = []
39-
flow_store = []
4026
flow_definition = []
4127
flow_config = []
42-
all = ["flow_queue", "flow_store", "flow_definition", "flow_config"]
28+
all = ["flow_definition", "flow_config"]

src/flow_config/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ pub fn load_env_file() {
3232
#[cfg(test)]
3333
mod tests {
3434
use super::*;
35-
use serial_test::serial;
3635
use std::env;
3736

3837
#[test]
39-
#[serial]
4038
fn test_env_with_default_string_exists() {
4139
let key = "TEST_STRING_VAR";
4240
let expected = "test_value";
@@ -54,7 +52,6 @@ mod tests {
5452
}
5553

5654
#[test]
57-
#[serial]
5855
fn test_env_with_default_string_missing() {
5956
let key = "TEST_MISSING_STRING_VAR";
6057
unsafe {
@@ -67,7 +64,6 @@ mod tests {
6764
}
6865

6966
#[test]
70-
#[serial]
7167
fn test_env_with_default_integer_exists() {
7268
let key = "TEST_INT_VAR";
7369
let expected = 42;
@@ -84,7 +80,6 @@ mod tests {
8480
}
8581

8682
#[test]
87-
#[serial]
8883
fn test_env_with_default_integer_missing() {
8984
let key = "TEST_MISSING_INT_VAR";
9085
unsafe {
@@ -97,7 +92,6 @@ mod tests {
9792
}
9893

9994
#[test]
100-
#[serial]
10195
fn test_env_with_default_boolean_exists_true() {
10296
let key = "TEST_BOOL_TRUE_VAR";
10397
unsafe {
@@ -113,7 +107,6 @@ mod tests {
113107
}
114108

115109
#[test]
116-
#[serial]
117110
fn test_env_with_default_boolean_exists_false() {
118111
let key = "TEST_BOOL_FALSE_VAR";
119112
unsafe {
@@ -129,7 +122,6 @@ mod tests {
129122
}
130123

131124
#[test]
132-
#[serial]
133125
fn test_env_with_default_boolean_missing() {
134126
let key = "TEST_MISSING_BOOL_VAR";
135127
unsafe {
@@ -142,7 +134,6 @@ mod tests {
142134
}
143135

144136
#[test]
145-
#[serial]
146137
fn test_env_with_default_boolean_invalid() {
147138
let key = "TEST_INVALID_BOOL_VAR";
148139
unsafe {
@@ -158,7 +149,6 @@ mod tests {
158149
}
159150

160151
#[test]
161-
#[serial]
162152
fn test_env_with_default_u32_exists() {
163153
let key = "TEST_U32_VAR";
164154
let expected = 42u32;
@@ -175,7 +165,6 @@ mod tests {
175165
}
176166

177167
#[test]
178-
#[serial]
179168
fn test_env_with_default_u32_negative_invalid() {
180169
let key = "TEST_U32_NEGATIVE_VAR";
181170
unsafe {
@@ -191,7 +180,6 @@ mod tests {
191180
}
192181

193182
#[test]
194-
#[serial]
195183
fn test_env_with_default_empty_string() {
196184
let key = "TEST_EMPTY_STRING_VAR";
197185
unsafe {
@@ -207,7 +195,6 @@ mod tests {
207195
}
208196

209197
#[test]
210-
#[serial]
211198
fn test_env_with_default_whitespace_string() {
212199
let key = "TEST_WHITESPACE_VAR";
213200
unsafe {
@@ -223,7 +210,6 @@ mod tests {
223210
}
224211

225212
#[test]
226-
#[serial]
227213
fn test_env_with_environment() {
228214
let key = "TEST_ENVIRONMENT";
229215
unsafe {
@@ -239,7 +225,6 @@ mod tests {
239225
}
240226

241227
#[test]
242-
#[serial]
243228
fn test_env_with_mode() {
244229
let key = "TEST_MODE";
245230
unsafe {

src/flow_definition/mod.rs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,39 @@ pub struct FlowUpdateService {
1616
}
1717

1818
impl FlowUpdateService {
19-
pub fn from_url(aquila_url: String) -> Self {
19+
/// Create a new FlowUpdateService instance from an Aquila URL and a definition path.
20+
///
21+
/// This will read the definition files from the given path and initialize the service with the data types, runtime definitions, and flow types.
22+
pub fn from_url(aquila_url: String, definition_path: &str) -> Self {
23+
let mut data_types = Vec::new();
24+
let mut runtime_definitions = Vec::new();
25+
let mut flow_types = Vec::new();
26+
27+
let definitions = match code0_definition_reader::parser::Parser::from_path(definition_path)
28+
{
29+
Some(reader) => reader,
30+
None => {
31+
log::error!("No definition folder found at path: {}", definition_path);
32+
return Self {
33+
aquila_url,
34+
data_types,
35+
runtime_definitions,
36+
flow_types,
37+
};
38+
}
39+
};
40+
41+
for feature in definitions.features {
42+
data_types.append(&mut feature.data_types.clone());
43+
flow_types.append(&mut feature.flow_types.clone());
44+
runtime_definitions.append(&mut feature.runtime_functions.clone());
45+
}
46+
2047
Self {
2148
aquila_url,
22-
data_types: Vec::new(),
23-
runtime_definitions: Vec::new(),
24-
flow_types: Vec::new(),
49+
data_types,
50+
runtime_definitions,
51+
flow_types,
2552
}
2653
}
2754

src/flow_queue/connection.rs

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/flow_queue/mod.rs

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)