Skip to content

Commit ccb4b0e

Browse files
committed
feat: satisfied new tucana interface
1 parent ba11fa4 commit ccb4b0e

5 files changed

Lines changed: 18 additions & 29 deletions

File tree

crates/taurus-core/src/runtime/engine.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ mod tests {
181181
value: Some(NodeValue {
182182
value: Some(node_value::Value::LiteralValue(value)),
183183
}),
184+
cast: None,
184185
}
185186
}
186187

@@ -189,8 +190,11 @@ mod tests {
189190
database_id,
190191
runtime_parameter_id: runtime_parameter_id.to_string(),
191192
value: Some(NodeValue {
192-
value: Some(node_value::Value::NodeFunctionId(node_id)),
193+
value: Some(node_value::Value::SubFlow(unimplemented!(
194+
"Taurus needs to handle SubFlows (issue nr #184)"
195+
))),
193196
}),
197+
cast: None,
194198
}
195199
}
196200

@@ -208,6 +212,7 @@ mod tests {
208212
paths: Vec::new(),
209213
})),
210214
}),
215+
cast: None,
211216
}
212217
}
213218

@@ -276,6 +281,7 @@ mod tests {
276281
paths: Vec::new(),
277282
})),
278283
}),
284+
cast: None,
279285
}
280286
}
281287

crates/taurus-core/src/runtime/engine/compiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn compile_flow(
125125
let arg = match value {
126126
node_value::Value::LiteralValue(v) => CompiledArg::Literal(v.clone()),
127127
node_value::Value::ReferenceValue(r) => CompiledArg::Reference(r.clone()),
128-
node_value::Value::NodeFunctionId(id) => CompiledArg::DeferredNode(*id),
128+
node_value::Value::SubFlow(_sub_flow) => unimplemented!("Taurus needs to handle SubFlows (issue nr #184)"),
129129
};
130130

131131
parameters.push(CompiledParameter {

crates/taurus-core/src/runtime/engine/executor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::cell::RefCell;
44
use std::collections::HashMap;
55

66
use futures_lite::future::block_on;
7-
use tucana::aquila::ExecutionRequest;
7+
use tucana::aquila::ActionExecutionRequest;
88
use tucana::shared::reference_value::Target;
99
use tucana::shared::value::Kind;
1010
use tucana::shared::{Struct, Value};
@@ -485,7 +485,7 @@ impl<'a> EngineExecutor<'a> {
485485
&self,
486486
node: &CompiledNode,
487487
values: Vec<Value>,
488-
) -> Result<ExecutionRequest, RuntimeError> {
488+
) -> Result<ActionExecutionRequest, RuntimeError> {
489489
if node.parameters.len() != values.len() {
490490
return Err(RuntimeError::new(
491491
"T-CORE-000005",
@@ -499,7 +499,7 @@ impl<'a> EngineExecutor<'a> {
499499
fields.insert(parameter.runtime_parameter_id.clone(), value);
500500
}
501501

502-
Ok(ExecutionRequest {
502+
Ok(ActionExecutionRequest {
503503
execution_identifier: Uuid::new_v4().to_string(),
504504
function_identifier: node.handler_id.clone(),
505505
parameters: Some(Struct { fields }),

crates/taurus-core/src/runtime/remote/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
//! trait without coupling the core engine to a specific transport.
55
66
use async_trait::async_trait;
7-
use tucana::{aquila::ExecutionRequest, shared::Value};
7+
use tucana::{aquila::ActionExecutionRequest, shared::Value};
88

99
use crate::types::errors::runtime_error::RuntimeError;
1010

1111
pub struct RemoteExecution {
1212
/// Remote service identifier to route the call.
1313
pub target_service: String,
1414
/// Execution request payload expected by the remote runtime.
15-
pub request: ExecutionRequest,
15+
pub request: ActionExecutionRequest,
16+
1617
}
1718

1819
#[async_trait]

crates/taurus-provider/src/providers/remote/nats_remote_runtime.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use prost::Message;
33
use taurus_core::runtime::remote::{RemoteExecution, RemoteRuntime};
44
use taurus_core::types::errors::runtime_error::RuntimeError;
55
use tonic::async_trait;
6-
use tucana::aquila::ExecutionResult;
6+
use tucana::aquila::ActionExecutionResponse;
77
use tucana::shared::Value;
88

99
pub struct NATSRemoteRuntime {
@@ -42,8 +42,8 @@ impl RemoteRuntime for NATSRemoteRuntime {
4242
}
4343
};
4444

45-
let decode_result = ExecutionResult::decode(message.payload);
46-
let execution_result = match decode_result {
45+
let decode_result = ActionExecutionResponse::decode(message.payload);
46+
let _execution_result = match decode_result {
4747
Ok(r) => r,
4848
Err(err) => {
4949
log::error!(
@@ -58,24 +58,6 @@ impl RemoteRuntime for NATSRemoteRuntime {
5858
}
5959
};
6060

61-
match execution_result.result {
62-
Some(result) => match result {
63-
tucana::aquila::execution_result::Result::Success(value) => Ok(value),
64-
tucana::aquila::execution_result::Result::Error(err) => {
65-
let code = err.code.to_string();
66-
let description = match err.description {
67-
Some(string) => string,
68-
None => "Unknown Error".to_string(),
69-
};
70-
let error = RuntimeError::new(code, "RemoteExecutionError", description);
71-
Err(error)
72-
}
73-
},
74-
None => Err(RuntimeError::new(
75-
"T-PROV-000003",
76-
"RemoteRuntimeExeption",
77-
"Result of Remote Response was empty.",
78-
)),
79-
}
61+
unimplemented!("Taurus needs to handle text executions (issue nr #185)")
8062
}
8163
}

0 commit comments

Comments
 (0)