Replace async_channel with event_listener in bevy_tasks#11942
Closed
james7132 wants to merge 7 commits intobevyengine:mainfrom
Closed
Replace async_channel with event_listener in bevy_tasks#11942james7132 wants to merge 7 commits intobevyengine:mainfrom
james7132 wants to merge 7 commits intobevyengine:mainfrom
Conversation
afonsolage
approved these changes
Feb 18, 2024
hymm
approved these changes
Feb 18, 2024
Member
|
CI failure looks related: can you investigate? |
MiniaczQ
approved these changes
Feb 26, 2024
crates/bevy_tasks/src/task_pool.rs
Outdated
| /// Inner state of the pool | ||
| threads: Vec<JoinHandle<()>>, | ||
| shutdown_tx: async_channel::Sender<()>, | ||
| shutdown: Arc<event_listener::Event>, |
Contributor
There was a problem hiding this comment.
No need for fully qualified path
alice-i-cecile
requested changes
Feb 26, 2024
Member
alice-i-cecile
left a comment
There was a problem hiding this comment.
CI keeps hanging. IMO we should just close this rather than trying to debug further: the gains here are not significant.
hymm
reviewed
Feb 26, 2024
crates/bevy_tasks/src/task_pool.rs
Outdated
| impl Drop for TaskPool { | ||
| fn drop(&mut self) { | ||
| self.shutdown_tx.close(); | ||
| self.shutdown.notify(self.threads.len()); |
Contributor
There was a problem hiding this comment.
might be worth trying usize::MAX here and seeing if it helps.
Member
Author
There was a problem hiding this comment.
I already tried this above and it doesn't seem to work.
Member
Author
|
I think my mental model of how event_listener works might not be sufficient .Closing this out for now. Might not need it if #11995 gets merged. |
Member
Author
|
Welp tried again, nope still not working as expected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
We don't actually need the full functionality of
async_channelforbevy_tasks, which is only used for shutdown of the TaskPool on drop.Solution
Replace it with
event_listener, which is already in the bevy_tasks dependency subtree.This likely won't save us much, since we do need async_channel for bevy_ecs, but it should keep the dependency tree a bit cleaner here.