@@ -4,12 +4,11 @@ use crate::{
44 store:: AdapterStore ,
55 traits:: { LoadConfig , Server as AdapterServer } ,
66} ;
7- use code0_flow:: flow_service:: FlowUpdateService ;
7+ use code0_flow:: flow_service:: { FlowUpdateService , ModuleDefinitionAppendix } ;
88use std:: { sync:: Arc , time:: Duration } ;
99use tokio:: { signal, task:: JoinHandle , time:: sleep} ;
1010use tonic:: transport:: Server ;
1111use tonic_health:: pb:: health_server:: HealthServer ;
12- use tucana:: shared:: AdapterStatusConfiguration ;
1312
1413/// Context passed to adapter server implementations containing all shared resources
1514pub struct ServerContext < C : LoadConfig > {
@@ -56,10 +55,7 @@ impl<C: LoadConfig> ServerRunner<C> {
5655 } )
5756 }
5857
59- pub async fn serve (
60- self ,
61- runtime_config : Vec < AdapterStatusConfiguration > ,
62- ) -> anyhow:: Result < ( ) > {
58+ pub async fn serve ( self , appendix : Vec < ModuleDefinitionAppendix > ) -> anyhow:: Result < ( ) > {
6359 let config = self . context . adapter_config . clone ( ) ;
6460 let mut runtime_status_service: Option < Arc < DracoRuntimeStatusService > > = None ;
6561 let mut runtime_status_heartbeat_task: Option < JoinHandle < ( ) > > = None ;
@@ -71,26 +67,27 @@ impl<C: LoadConfig> ServerRunner<C> {
7167 config. aquila_url . clone ( ) ,
7268 config. aquila_token . clone ( ) ,
7369 config. draco_variant . clone ( ) ,
74- runtime_config,
7570 )
7671 . await ,
7772 ) ) ;
7873
7974 if let Some ( ser) = & runtime_status_service {
8075 ser. update_runtime_status_by_status (
81- tucana:: shared:: adapter_runtime_status :: Status :: NotReady ,
76+ tucana:: shared:: module_status :: StatusVariant :: NotReady ,
8277 )
8378 . await ;
8479 } ;
8580
8681 let service_name = format ! ( "draco-{}" , config. draco_variant. to_lowercase( ) ) ;
82+
8783 let mut definition_service = FlowUpdateService :: from_url (
8884 config. aquila_url . clone ( ) ,
8985 config. definition_path . as_str ( ) ,
9086 config. aquila_token . clone ( ) ,
9187 )
9288 . await
93- . with_definition_source ( service_name) ;
89+ . with_definition_source ( service_name)
90+ . with_appendix ( appendix) ;
9491
9592 let mut success = false ;
9693 let mut count = 1 ;
@@ -144,7 +141,7 @@ impl<C: LoadConfig> ServerRunner<C> {
144141
145142 if let Some ( ser) = & runtime_status_service {
146143 ser. update_runtime_status_by_status (
147- tucana:: shared:: adapter_runtime_status :: Status :: Running ,
144+ tucana:: shared:: module_status :: StatusVariant :: Running ,
148145 )
149146 . await ;
150147
@@ -163,7 +160,7 @@ impl<C: LoadConfig> ServerRunner<C> {
163160 interval. tick ( ) . await ;
164161 status_service
165162 . update_runtime_status_by_status (
166- tucana:: shared:: adapter_runtime_status :: Status :: Running ,
163+ tucana:: shared:: module_status :: StatusVariant :: Running ,
167164 )
168165 . await ;
169166 }
@@ -251,7 +248,7 @@ impl<C: LoadConfig> ServerRunner<C> {
251248
252249 if let Some ( ser) = & runtime_status_service {
253250 ser. update_runtime_status_by_status (
254- tucana:: shared:: adapter_runtime_status :: Status :: Stopped ,
251+ tucana:: shared:: module_status :: StatusVariant :: Stopped ,
255252 )
256253 . await ;
257254 } ;
0 commit comments