-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix file_watcher feature hanging indefinitely #10585
Fix file_watcher feature hanging indefinitely #10585
Conversation
Rather than enabling the
|
I'll update the PR with this in mind |
I don't have |
@SludgePhD I now removed the reference to #10576 thank for pointing that out! |
# Objective Fix the `bevy_asset/file_watcher` feature in practice depending on multithreading, while not informing the user of it. **As I understand it** (I didn't check it), the file watcher feature depends on spawning a concurrent thread to receive file update events from the `notify-debouncer-full` crate. But if multithreading is disabled, that thread will never have time to read the events and consume them. - Fixes bevyengine#10573 ## Solution Add a `compile_error!` causing compilation failure if `file_watcher` is enabled while `multi-threaded` is disabled. This is considered better than adding a dependency on `multi-threaded` on the `file_watcher`, as (according to @mockersf) toggling on/off `multi-threaded` has a non-zero chance of changing behavior. And we shouldn't implicitly change behavior. A compilation failure prevents compilation of code that is invalid, while informing the user of the steps needed to fix it.
Objective
Fix the
bevy_asset/file_watcher
feature in practice depending on multithreading, while not informing the user of it.As I understand it (I didn't check it), the file watcher feature depends on spawning a concurrent thread to receive file update events from the
notify-debouncer-full
crate. But if multithreading is disabled, that thread will never have time to read the events and consume them.Solution
Add a
compile_error!
causing compilation failure iffile_watcher
is enabled whilemulti-threaded
is disabled.This is considered better than adding a dependency on
multi-threaded
on thefile_watcher
, as (according to @mockersf) toggling on/offmulti-threaded
has a non-zero chance of changing behavior. And we shouldn't implicitly change behavior. A compilation failure prevents compilation of code that is invalid, while informing the user of the steps needed to fix it.