11use crate :: {
2- client:: DracoRuntimeStatusService ,
2+ client:: { DracoRuntimeStatusService } ,
33 config:: AdapterConfig ,
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 > {
@@ -58,7 +57,7 @@ impl<C: LoadConfig> ServerRunner<C> {
5857
5958 pub async fn serve (
6059 self ,
61- runtime_config : Vec < AdapterStatusConfiguration > ,
60+ appendix : Vec < ModuleDefinitionAppendix > ,
6261 ) -> anyhow:: Result < ( ) > {
6362 let config = self . context . adapter_config . clone ( ) ;
6463 let mut runtime_status_service: Option < Arc < DracoRuntimeStatusService > > = None ;
@@ -71,26 +70,27 @@ impl<C: LoadConfig> ServerRunner<C> {
7170 config. aquila_url . clone ( ) ,
7271 config. aquila_token . clone ( ) ,
7372 config. draco_variant . clone ( ) ,
74- runtime_config,
7573 )
7674 . await ,
7775 ) ) ;
7876
7977 if let Some ( ser) = & runtime_status_service {
8078 ser. update_runtime_status_by_status (
81- tucana:: shared:: adapter_runtime_status :: Status :: NotReady ,
79+ tucana:: shared:: module_status :: StatusVariant :: NotReady ,
8280 )
8381 . await ;
8482 } ;
8583
8684 let service_name = format ! ( "draco-{}" , config. draco_variant. to_lowercase( ) ) ;
85+
8786 let mut definition_service = FlowUpdateService :: from_url (
8887 config. aquila_url . clone ( ) ,
8988 config. definition_path . as_str ( ) ,
9089 config. aquila_token . clone ( ) ,
9190 )
9291 . await
93- . with_definition_source ( service_name) ;
92+ . with_definition_source ( service_name)
93+ . with_appendix ( appendix) ;
9494
9595 let mut success = false ;
9696 let mut count = 1 ;
@@ -144,7 +144,7 @@ impl<C: LoadConfig> ServerRunner<C> {
144144
145145 if let Some ( ser) = & runtime_status_service {
146146 ser. update_runtime_status_by_status (
147- tucana:: shared:: adapter_runtime_status :: Status :: Running ,
147+ tucana:: shared:: module_status :: StatusVariant :: Running ,
148148 )
149149 . await ;
150150
@@ -163,7 +163,7 @@ impl<C: LoadConfig> ServerRunner<C> {
163163 interval. tick ( ) . await ;
164164 status_service
165165 . update_runtime_status_by_status (
166- tucana:: shared:: adapter_runtime_status :: Status :: Running ,
166+ tucana:: shared:: module_status :: StatusVariant :: Running ,
167167 )
168168 . await ;
169169 }
@@ -251,7 +251,7 @@ impl<C: LoadConfig> ServerRunner<C> {
251251
252252 if let Some ( ser) = & runtime_status_service {
253253 ser. update_runtime_status_by_status (
254- tucana:: shared:: adapter_runtime_status :: Status :: Stopped ,
254+ tucana:: shared:: module_status :: StatusVariant :: Stopped ,
255255 )
256256 . await ;
257257 } ;
0 commit comments