dont spawn a runtime in machine; inherit from outside with runtime::handle::Current

This commit is contained in:
Joshua Parkin
2023-08-03 16:22:03 +01:00
parent 3ff02da314
commit 65eb93793c
4 changed files with 24 additions and 19 deletions

View File

@@ -53,7 +53,6 @@ use std::env;
use std::io::Read;
use std::path::PathBuf;
use std::sync::atomic::AtomicBool;
use tokio::runtime::Runtime;
use self::config::MachineConfig;
use self::parsed_results::*;
@@ -71,7 +70,6 @@ pub struct Machine {
pub(super) user_output: Stream,
pub(super) user_error: Stream,
pub(super) load_contexts: Vec<LoadContext>,
pub(super) runtime: Runtime,
}
#[derive(Debug)]
@@ -452,8 +450,6 @@ impl Machine {
),
};
let runtime = tokio::runtime::Runtime::new().unwrap();
let mut wam = Machine {
machine_st,
indices: IndexStore::new(),
@@ -462,7 +458,6 @@ impl Machine {
user_output,
user_error,
load_contexts: vec![],
runtime,
};
let mut lib_path = current_dir();