1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use Future;
use JoinHandle;
use spawn_local;
// #[cfg(target_arch = "wasm32")]
// pub(crate) fn spawn<F>(future: F)
// where
// F: Future<Output = ()> + 'static,
// {
// spawn_local(future);
// }
/// Spawns a future on the current Tokio runtime.
///
/// # Returns
///
/// A [`tokio::task::JoinHandle`] that can be awaited for the future output.
///
/// # Examples
///
/// ```no_run
/// # async fn demo() {
/// let handle = vibe_ready::platform::spawn(async { 7 });
/// assert_eq!(handle.await.expect("task joins"), 7);
/// # }
/// ```