-
Hello, first and foremost thanks for this library. I'm currently developing a native plugin for game modding with a Rust crate (namely red4ext-rs). Foreseeing that in the future multiple mods could be loading many YAML files with dozens of audio file paths and subtitles, I was considering adding My experiment is roughly like this: lazy_static! {
static ref EXECUTOR: Executor<'static> = Executor::new();
}
pub fn setup() -> anyhow::Result<()> {
EXECUTOR.spawn(async {
match banks::setup().await { // where banks::setup() is an async fn, the one that loads everything
// both of these lines simply log to a file
Ok(_) => { red4ext_rs::info!("banks loaded successfully!"); }
Err(e) => { red4ext_rs::error!("failed to load banks ({e})"); }
}
}).detach();
// some more setup ...
Ok(())
} The result is that there's no crash, but no success or error message is written to the logs. Do you know by any chance what I could possibly be missing? Thanks in advance 😃 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need to call
|
Beta Was this translation helpful? Give feedback.
You need to call
run
to drive the future. Executors on their own don't run, you need to drive them. For example: