2
0
Fork 0
mirror of https://github.com/bevyengine/bevy synced 2024-12-24 20:13:07 +00:00
bevy/crates/bevy_core
Logic bafb9a25fb
Support on_thread_spawn and on_thread_destroy for TaskPoolPlugin ()
# Objective

- Allow to configure `on_thread_spawn` and `on_thread_destroy` when
using `TaskPoolPlugin` of bevy.

## Solution

- In `TaskPoolThreadAssignmentPolicy`, two options `on_thread_spawn` and
`on_thread_destroy` are 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_spawn` option and `on_thread_destroy` option to the
`TaskPoolPlugin`, allow user to customize them as needed.

## Migration Guide

- `TaskPooolThreadAssignmentPolicy` now has two additional fields:
`on_thread_spawn` and `on_thread_destroy`. Please consider defaulting
them to `None`.

---------

Co-authored-by: François Mockers <mockersf@gmail.com>
Co-authored-by: François Mockers <francois.mockers@vleue.com>
2024-11-11 20:00:01 +00:00
..
src Support on_thread_spawn and on_thread_destroy for TaskPoolPlugin () 2024-11-11 20:00:01 +00:00
Cargo.toml chore(deps): remove unused uuid dependency from bevy_core () 2024-11-05 23:31:58 +00:00
README.md Add README.md to all crates () 2024-05-02 18:56:00 +00:00

Bevy Core

License Crates.io Downloads Docs Discord