(&mut self)
| 466 | |
| 467 | #[tracing::instrument(level = "debug", skip(self))] |
| 468 | async fn spawn_extensions(&mut self) { |
| 469 | let manifests = self.find_extensions().await; |
| 470 | for manifest in manifests { |
| 471 | let package_name = manifest.name.clone(); |
| 472 | let extension_map = self.extensions_map.clone(); |
| 473 | let reply_map = self.reply_map.clone(); |
| 474 | let ext_command_tx = self.ext_command_tx.clone(); |
| 475 | thread::spawn(move || { |
| 476 | let extension = Self::spawn_extension(manifest, reply_map, ext_command_tx.clone()); |
| 477 | let plugin = extension.plugin.clone(); |
| 478 | let mut plugin = block_on(plugin.lock()); |
| 479 | tracing::trace!("Callign entry"); |
| 480 | plugin.call::<(), ()>("entry", ()).unwrap(); |
| 481 | |
| 482 | let mut extensions_map = block_on(extension_map.lock()); |
| 483 | extensions_map.insert(package_name, extension); |
| 484 | |
| 485 | ext_command_tx |
| 486 | .send(MainCommand::ExtensionsUpdated().to_request().unwrap()) |
| 487 | .unwrap(); |
| 488 | }); |
| 489 | } |
| 490 | |
| 491 | if let Err(e) = self |
| 492 | .ext_command_tx |
| 493 | .send(MainCommand::ExtensionsUpdated().to_request().unwrap()) |
| 494 | { |
| 495 | tracing::error!("Failed to send extension update command: {:?}", e); |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | #[tracing::instrument(level = "debug", skip(self))] |
| 500 | async fn get_extensions(&self, package_name: String) -> Vec<Extension> { |
no test coverage detected