@@ -4,7 +4,7 @@ use taurus_core::runtime::remote::{RemoteExecution, RemoteRuntime};
44use taurus_core:: types:: errors:: runtime_error:: RuntimeError ;
55use tonic:: async_trait;
66use tucana:: aquila:: ActionExecutionResponse ;
7- use tucana:: shared:: Value ;
7+ use tucana:: shared:: { NodeExecutionResult } ;
88
99pub struct NATSRemoteRuntime {
1010 client : Client ,
@@ -18,7 +18,7 @@ impl NATSRemoteRuntime {
1818
1919#[ async_trait]
2020impl RemoteRuntime for NATSRemoteRuntime {
21- async fn execute_remote ( & self , execution : RemoteExecution ) -> Result < Value , RuntimeError > {
21+ async fn execute_remote ( & self , execution : RemoteExecution ) -> Result < NodeExecutionResult , RuntimeError > {
2222 let topic = format ! (
2323 "action.{}.{}" ,
2424 execution. target_service, execution. request. execution_identifier
@@ -43,8 +43,18 @@ impl RemoteRuntime for NATSRemoteRuntime {
4343 } ;
4444
4545 let decode_result = ActionExecutionResponse :: decode ( message. payload ) ;
46- let _execution_result = match decode_result {
47- Ok ( r) => r,
46+ match decode_result {
47+ Ok ( r) => match r. node_result {
48+ Some ( res) => Ok ( res) ,
49+ None => {
50+ log:: error!( "RemoteRuntimeExeption: recieved execution result without an body" ) ;
51+ return Err ( RuntimeError :: new (
52+ "T-PROV-000003" ,
53+ "RemoteRuntimeExeption" ,
54+ "Recieved empty action execution response" ,
55+ ) ) ;
56+ } ,
57+ } ,
4858 Err ( err) => {
4959 log:: error!(
5060 "RemoteRuntimeExeption: failed to decode NATS message: {}" ,
@@ -56,8 +66,6 @@ impl RemoteRuntime for NATSRemoteRuntime {
5666 "Failed to read Remote Response" ,
5767 ) ) ;
5868 }
59- } ;
60-
61- unimplemented ! ( "Taurus needs to handle text executions (issue nr #185)" )
69+ }
6270 }
6371}
0 commit comments