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

@@ -7,6 +7,13 @@ fn main() {
scryer_prolog::machine::INTERRUPT.store(true, Ordering::Relaxed);
}).unwrap();
let mut wam = machine::Machine::new(Default::default());
wam.run_top_level(atom!("$toplevel"), (atom!("$repl"), 1));
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap();
runtime.block_on(async move {
let mut wam = machine::Machine::new(Default::default());
wam.run_top_level(atom!("$toplevel"), (atom!("$repl"), 1));
});
}