Implement installation wizard for comet in devtools
This commit is contained in:
parent
00ee6ab47a
commit
5c39cd4478
3 changed files with 274 additions and 64 deletions
19
devtools/src/executor.rs
Normal file
19
devtools/src/executor.rs
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue