we connect now

This commit is contained in:
Sebastian Moser
2024-08-12 23:14:40 +02:00
parent eb1b94a650
commit ae5bbd4028
3 changed files with 14 additions and 3 deletions

View File

@@ -292,6 +292,13 @@ impl Instance {
runtime_inner.spawn(func);
}
#[cfg(feature = "async")]
pub fn spawn_async_blocking<F: Future<Output = impl Send + Sync + 'static> + Send + Sync + 'static>(&mut self, name: &str, func: F) {
self.threads.push(name.to_owned());
let runtime_inner = self.runtime.lock().unwrap();
runtime_inner.block_on(func);
}
pub fn wait(&self) {
loop {
thread::sleep_ms(10000000)