core: route_from runs a plugin from another .wasm file (seam for activation)
Stop tracking examples/notes/Cargo.lock.
This commit is contained in:
+15
-1
@@ -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?;
|
||||
|
||||
Reference in New Issue
Block a user