From bad4b773b7bbab6a38d4f48d88d8c5a8787927ac Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 24 Jan 2022 15:21:56 -0500 Subject: [PATCH] feat: add "spawn" method --- packages/core/src/scopes.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/src/scopes.rs b/packages/core/src/scopes.rs index c54918b55..77c648d18 100644 --- a/packages/core/src/scopes.rs +++ b/packages/core/src/scopes.rs @@ -751,6 +751,11 @@ impl ScopeState { self.tasks.push_fut(fut) } + /// Spawns the future but does not return the TaskId + pub fn spawn(&self, fut: impl Future + 'static) { + self.push_future(fut); + } + // todo: attach some state to the future to know if we should poll it pub fn remove_future(&self, id: TaskId) { self.tasks.remove_fut(id);