Skip to content

Expose SystemExecutor & open up ExecutorKind again #8027

@farnoy

Description

@farnoy

What problem does this solve or what need does it fill?

During the implementation of #7267 & #6587 (stageless ECS schedules), the old 0.9 API of pub fn set_executor(&mut self, executor: Box<dyn ParallelSystemExecutor>) was replaced by a closed enum in the form of ExecutorKind. I'd like to see a similar API exposed again to be able to implement custom executors - specifically a Rayon-based one.

What solution would you like?

I think it would be sensible to add a variant like ExecutorKind::Custom(Box<dyn SystemExecutor>).

What alternative(s) have you considered?

A better abstraction level could be to allow other implementations of ComputeTaskPool instead, but I'm not familiar enough with the internals to know if it's feasible.

Additional context

I wasn't happy with the behavior (#4161) or performance of async_executor when used as the executor, so I rolled out my own implementation that I've been using successfully with bevy_ecs` 0.6.0 - 0.9.1. As of 0.10.0, there doesn't seem to be a way to use a custom executor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-ComplexQuite challenging from either a design or technical perspective. Ask for help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions