Struct specs::AsyncDispatcher
source · pub struct AsyncDispatcher<'a, R> { /* private fields */ }
Expand description
Like, Dispatcher
but works asynchronously.
Implementations§
source§impl<'a, R> AsyncDispatcher<'a, R>where
R: Borrow<World> + Send + Sync + 'static,
impl<'a, R> AsyncDispatcher<'a, R>where R: Borrow<World> + Send + Sync + 'static,
sourcepub fn setup(&mut self)where
R: BorrowMut<World>,
pub fn setup(&mut self)where R: BorrowMut<World>,
Sets up all the systems which means they are gonna add default values for the resources they need.
sourcepub fn dispatch(&mut self)
pub fn dispatch(&mut self)
Dispatches the systems asynchronously. Does not execute thread local systems.
If you want to wait for the systems to finish,
call wait()
.
sourcepub fn wait(&mut self)
pub fn wait(&mut self)
Waits for all the asynchronously dispatched systems to finish and executes thread local systems (if there are any).
sourcepub fn wait_without_tl(&mut self)
pub fn wait_without_tl(&mut self)
Waits for all the asynchronously dispatched systems to finish without executing thread local systems.
See wait
for executing thread local systems.
sourcepub fn running(&mut self) -> bool
pub fn running(&mut self) -> bool
Checks if any of the asynchronously dispatched systems are running.
sourcepub fn res(&mut self) -> &R
👎Deprecated since 0.8.0: renamed to world
pub fn res(&mut self) -> &R
world
Returns the World
.
This will wait for the asynchronous systems to finish.
Renamed to self.world()
.
sourcepub fn world(&mut self) -> &R
pub fn world(&mut self) -> &R
Returns the World
.
This will wait for the asynchronous systems to finish.