-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
make it easier to change app to single threaded stages #5966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think get_stage
should be defined somewhere else). It could very well replace App::new
, since, after all, it's in general used only once in a game, which I don't think is too burdensome to update. Though a deprecation warning period + a migration guide pointing out App::default
would be necessary.
crates/bevy_app/src/app.rs
Outdated
} | ||
|
||
app | ||
App::new_with_threading_option(AppThreading::Multi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea: What about adding a Default
to AppThreading
and calling AppThreading::default()
here? Just a suggestion
Also I had no idea |
I added constructors for |
@@ -114,6 +119,33 @@ impl App { | |||
} | |||
} | |||
|
|||
/// Creates a new [`App`] with some default structure with all default stages set to use single threaded system executor. | |||
pub fn single_threaded() -> App { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally this is an "app setting", which we use for all app stages (by default). Ex: replace instances of add_stage(Label, stage_reference)
with add_default_stage(Label)
. And with stageless on the horizon, this would need to be a global app setting anyway (ex: your only options are to use a single threaded app executor or a multithreaded app executor).
What are your thoughts on waiting for stageless before defining this api vs building this api (with stageless in mind)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with closing this out until after stageless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And with stageless on the horizon, this would need to be a global app setting anyway
This could be a per schedule setting in stageless.
Objective
correct_transforms_when_no_children
spuriously fails. #5285 to make it easy to switch the panicking test to single threaded.Solution
App::single_threaded
andApp::multithreaded
that allow users to construct an app with default stages as single threaded or multi threaded.Migration Guide
add_default_stages
now takes an option.Before
After
Notes
Not sure ifadded separate constructors with the option set insteadApp::new_with_threading_options
should just replaceApp::new()
. It would mean we'd need to change all the examples to useApp::default()
instead ofnew