(engine: &Engine)
| 1553 | } |
| 1554 | |
| 1555 | fn process_wasix_runtime(engine: &Engine) -> Result<Arc<WasixProcessRuntime>> { |
| 1556 | WASIX_PROCESS_RUNTIME |
| 1557 | .get_or_init(|| { |
| 1558 | let _phase = timing::phase("wasix.runtime_construct"); |
| 1559 | let tokio_runtime = { |
| 1560 | let _phase = timing::phase("wasix.runtime_construct.tokio"); |
| 1561 | Arc::new( |
| 1562 | tokio::runtime::Builder::new_multi_thread() |
| 1563 | .enable_all() |
| 1564 | .build() |
| 1565 | .context("create Tokio runtime for Wasmer/WASIX filesystem") |
| 1566 | .map_err(|err| format!("{err:#}"))?, |
| 1567 | ) |
| 1568 | }; |
| 1569 | let wasix_module_cache = { |
| 1570 | let _phase = timing::phase("wasix.runtime_construct.module_cache"); |
| 1571 | Arc::new(SharedCache::new()) |
| 1572 | }; |
| 1573 | let wasix_runtime = { |
| 1574 | let _phase = timing::phase("wasix.runtime_construct.pluggable_runtime"); |
| 1575 | build_wasix_runtime(&tokio_runtime, engine, wasix_module_cache.clone()) |
| 1576 | }; |
| 1577 | |
| 1578 | Ok(Arc::new(WasixProcessRuntime { |
| 1579 | tokio_runtime, |
| 1580 | wasix_module_cache, |
| 1581 | wasix_runtime, |
| 1582 | })) |
| 1583 | }) |
| 1584 | .clone() |
| 1585 | .map_err(|message| anyhow::anyhow!(message)) |
| 1586 | } |
| 1587 | |
| 1588 | struct WasixInstantiateInput<'a> { |
| 1589 | runtime: &'a TokioRuntime, |
no test coverage detected