Struct specs::Planner
[−]
[src]
pub struct Planner<C> { pub world: Arc<World>, pub systems: Vec<SystemInfo<C>>, // some fields omitted }
System execution planner. Allows running systems via closures, distributes the load in parallel using a thread pool.
Fields
world: Arc<World>
Shared World
.
systems: Vec<SystemInfo<C>>
Permanent systems in the planner.
Methods
impl<C: 'static> Planner<C>
[src]
fn new(world: World, num_threads: usize) -> Planner<C>
Creates a new planner, given the world and the thread count.
fn add_system<S>(&mut self, sys: S, name: &str, priority: Priority) where S: 'static + System<C>
Add a system to the dispatched list.
fn run_custom<F>(&mut self, functor: F) where F: 'static + Send + FnOnce(RunArg)
Runs a custom system.
fn wait(&mut self)
Waits for all currently executing systems to finish, and then merges all queued changes.
impl<C: Clone + Send + 'static> Planner<C>
[src]
fn dispatch(&mut self, context: C)
Dispatch all systems according to their associated priorities.