bevy/crates/bevy_tasks/src
Logic bafb9a25fb
Support on_thread_spawn and on_thread_destroy for TaskPoolPlugin (#13045)
# 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
..
iter Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
lib.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
single_threaded_task_pool.rs Support on_thread_spawn and on_thread_destroy for TaskPoolPlugin (#13045) 2024-11-11 20:00:01 +00:00
slice.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
task.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
task_pool.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
thread_executor.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
usages.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
wasm_task.rs Resolve unused_qualifications warnings (#16001) 2024-10-19 16:59:58 +00:00