bevy
bevy copied to clipboard
Support `on_thread_spawn` and `on_thread_destroy` for `TaskPoolPlugin`
Objective
- Allow to configure
on_thread_spawnandon_thread_destroywhen usingTaskPoolPluginof bevy.
Solution
- In
TaskPoolThreadAssignmentPolicy, two optionson_thread_spawnandon_thread_destroyare added, which will be passed to two new methods motioned above when creating corresponding task pool using builder. - Due to lack of debug derive for these two options, manually implement the debug for
TaskPoolThreadAssignmentPolicy.
Changelog
Added
on_thread_spawnoption andon_thread_destroyoption to theTaskPoolPlugin, allow user to customize them as needed.
Migration Guide
TaskPooolThreadAssignmentPolicynow has two additional fields:on_thread_spawnandon_thread_destroy. Please consider defaulting them toNone.
Welcome, new contributor!
Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨
Ah of course, don't know how I missed those.