trying to find a way for a central tokio::runtime

This commit is contained in:
Chris Cochrun 2023-11-19 07:16:13 -06:00
parent e9c78e4ea6
commit ebce1449d6

View file

@ -47,10 +47,21 @@ mod db {
#[cxx_qt::bridge]
mod utilities {
use tokio::runtime::Runtime;
#[cxx_qt::qobject]
#[derive(Default, Debug)]
pub struct Utils {}
#[derive(Debug)]
pub struct Utils {
runtime: Runtime,
}
impl Default for Utils {
fn default() -> Self {
Self {
runtime: tokio::runtime::Runtime::new().unwrap(),
}
}
}
impl qobject::Utils {
#[qinvokable]