rsiot/executor/
join_set_spawn.rs1use std::future::Future;
2
3use tokio::task::JoinSet;
4
5#[cfg(feature = "single-thread")]
6pub fn join_set_spawn<F, T>(join_set: &mut JoinSet<T>, task: F)
8where
9 F: Future<Output = T> + 'static,
10 T: Send + 'static,
11{
12 join_set.spawn_local(task);
13}
14
15#[cfg(not(feature = "single-thread"))]
16pub fn join_set_spawn<F, T>(join_set: &mut JoinSet<T>, task: F)
18where
19 F: Future<Output = T> + Send + 'static,
20 T: Send + 'static,
21{
22 join_set.spawn(task);
23}