Basic UI work
This commit is contained in:
parent
ba677af0f4
commit
9ed29eab94
6 changed files with 77 additions and 7 deletions
14
applets/cosmic-applet-network/src/task.rs
Normal file
14
applets/cosmic-applet-network/src/task.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
use std::future::Future;
|
||||
|
||||
pub fn spawn<O, F>(future: F) -> tokio::task::JoinHandle<O>
|
||||
where
|
||||
F: Future<Output = O> + Send + 'static,
|
||||
O: Send + 'static,
|
||||
{
|
||||
crate::RT.spawn(future)
|
||||
}
|
||||
|
||||
pub fn spawn_local<F: Future<Output = ()> + 'static>(future: F) {
|
||||
gtk4::glib::MainContext::default().spawn_local(future);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue