fix reqwest::blocking in tokio context via block_in_place; add state_get/state_set
This commit is contained in:
+4
-2
@@ -388,7 +388,8 @@ async fn run(cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let artifact = std::fs::read(&out.artifact_path)?;
|
||||
let instructions = el_compiler::Bytecode::deserialize_all(&artifact)
|
||||
.unwrap_or_default();
|
||||
run_interpreter(&instructions);
|
||||
// block_in_place lets the interpreter use reqwest::blocking from within tokio::main
|
||||
tokio::task::block_in_place(|| run_interpreter(&instructions));
|
||||
}
|
||||
|
||||
Command::Test { filter, e2e, all, output, manifest } => {
|
||||
@@ -568,7 +569,8 @@ async fn run(cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
let instructions = el_compiler::Bytecode::deserialize_all(&compiled.artifact)
|
||||
.unwrap_or_default();
|
||||
run_interpreter_with_args(&instructions, &args);
|
||||
// block_in_place lets the interpreter use reqwest::blocking from within tokio::main
|
||||
tokio::task::block_in_place(|| run_interpreter_with_args(&instructions, &args));
|
||||
}
|
||||
|
||||
Command::BuildFile { file, target, output } => {
|
||||
|
||||
Reference in New Issue
Block a user