We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dcbf737 commit 0502813Copy full SHA for 0502813
src/task.rs
@@ -92,6 +92,17 @@ mod wasm {
92
AbortHandle { state }
93
}
94
95
+ /// Alias to [`Self::spawn`].
96
+ ///
97
+ /// Mirrors [`tokio::JoinSet::spawn_local](https://docs.rs/tokio/latest/tokio/task/struct.JoinSet.html#method.spawn_local).
98
+ /// Because all tasks in WebAssembly are local, this is a simple alias to [`Self::spawn`].
99
+ pub fn spawn_local(&mut self, fut: impl IntoFuture<Output = T> + 'static) -> AbortHandle
100
+ where
101
+ T: 'static,
102
+ {
103
+ self.spawn(fut)
104
+ }
105
+
106
/// Aborts all tasks inside this `JoinSet`
107
pub fn abort_all(&self) {
108
self.to_cancel.iter().for_each(JoinHandle::abort);
0 commit comments