core: route_from runs a plugin from another .wasm file (seam for activation)

Stop tracking examples/notes/Cargo.lock.
This commit is contained in:
2026-10-23 00:37:09 +01:00
parent 8d3c163992
commit 7bbcd47837
2 changed files with 15 additions and 676 deletions
+15 -1
View File
@@ -51,6 +51,20 @@ impl Host {
method: String,
params: Value,
detached: bool,
) -> NativeFuture {
self.route_from(caller, id, method, params, detached, None)
}
/// Like `route`, but a WASI process runs the component at `wasm` instead
/// of the current `plugin.wasm` of its plugin. Activation uses this to
/// call `rpc.discover` on a candidate file.
pub(crate) fn route_from(
&self,
caller: String,
id: Option<Value>,
method: String,
params: Value,
detached: bool,
wasm: Option<std::path::PathBuf>,
) -> NativeFuture {
let host = self.clone();
Box::pin(async move {
@@ -87,7 +101,7 @@ impl Host {
.0
.components
.load(
host.0.world.plugin_dir(plugin).join("plugin.wasm"),
wasm.unwrap_or_else(|| host.0.world.plugin_dir(plugin).join("plugin.wasm")),
host.0.runtime.clone(),
)
.await?;