weired implementation of stream parsing cbor items from a unix sock, but it works

This commit is contained in:
Sebastian Moser
2024-06-20 18:03:43 +02:00
parent 053742f849
commit 6cb0aa1272
6 changed files with 642 additions and 65 deletions

View File

@@ -1,6 +1,7 @@
use core::fmt;
use std::collections::HashMap;
use std::fs::create_dir;
use std::thread::JoinHandle;
use std::{thread, vec};
use crossbeam::channel;
use std::sync::{Arc, Mutex};
@@ -51,7 +52,7 @@ pub struct Instance {
context: Vec<MizeId>,
threads: Vec<String>,
#[cfg(feature = "async")]
runtime: Arc<Mutex<Runtime>>,
pub runtime: Arc<Mutex<Runtime>>,
}
pub struct InstanceRef {
@@ -218,6 +219,12 @@ impl Instance {
let runtime_inner = self.runtime.lock().unwrap();
runtime_inner.spawn(func);
}
pub fn wait(&self) {
loop {
thread::sleep_ms(10000000)
}
}
}
impl fmt::Debug for Instance {