Implement installation wizard for comet in devtools

This commit is contained in:
Héctor Ramón Jiménez 2025-04-06 17:21:20 +02:00
parent 00ee6ab47a
commit 5c39cd4478
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 274 additions and 64 deletions

19
devtools/src/executor.rs Normal file
View file

@ -0,0 +1,19 @@
use crate::futures::futures::channel::mpsc;
use crate::runtime::Task;
use std::thread;
pub fn spawn_blocking<T>(
f: impl FnOnce(mpsc::Sender<T>) + Send + 'static,
) -> Task<T>
where
T: Send + 'static,
{
let (sender, receiver) = mpsc::channel(1);
let _ = thread::spawn(move || {
f(sender);
});
Task::stream(receiver)
}