MCPcopy Create free account
hub / github.com/apache/dubbo-rust / start

Method start

dubbo/src/framework.rs:110–145  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

108 }
109
110 pub async fn start(&mut self) {
111 self.init().unwrap();
112 info!("starting...");
113 // TODO: server registry
114
115 let mut registry_extensions = Vec::new();
116
117 for registry_url in &self.registries {
118 let registry_url = registry_url.clone();
119 let registry_extension = extension::EXTENSIONS.load_registry(registry_url).await;
120 if let Ok(registry_extension) = registry_extension {
121 registry_extensions.push(registry_extension);
122 }
123 }
124
125 let mem_reg = Box::new(
126 RegistryProtocol::new()
127 .with_registries(registry_extensions.clone())
128 .with_services(self.service_registry.clone()),
129 );
130 let mut async_vec: Vec<Pin<Box<dyn Future<Output = BoxExporter> + Send>>> = Vec::new();
131 for (name, items) in self.protocols.iter() {
132 for url in items.iter() {
133 info!("base: {:?}, service url: {:?}", name, url);
134 let exporter = mem_reg.clone().export(url.to_owned());
135 async_vec.push(exporter);
136
137 //TODO multiple registry
138 for registry_extension in &registry_extensions {
139 let _ = registry_extension.register(url.clone()).await;
140 }
141 }
142 }
143
144 let _res = future::join_all(async_vec).await;
145 }
146}
147
148impl Drop for Dubbo {

Callers 1

mainFunction · 0.45

Calls 7

load_registryMethod · 0.80
with_registriesMethod · 0.80
initMethod · 0.45
cloneMethod · 0.45
with_servicesMethod · 0.45
exportMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected