Skip to content
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

Unused CountdownEvent #4287

Closed
MiniaczQ opened this issue Mar 21, 2022 · 6 comments
Closed

Unused CountdownEvent #4287

MiniaczQ opened this issue Mar 21, 2022 · 6 comments
Labels
A-Tasks Tools for parallel and async work C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation

Comments

@MiniaczQ
Copy link
Contributor

How can Bevy's documentation be improved?

definition
re-export

Searching through source revealed that CountdownEvent is only used in it's definition file and in the module's re-export.
Should it be kept or deleted?

@MiniaczQ MiniaczQ added C-Docs An addition or correction to our documentation S-Needs-Triage This issue needs to be labelled labels Mar 21, 2022
@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change A-Tasks Tools for parallel and async work and removed S-Needs-Triage This issue needs to be labelled C-Docs An addition or correction to our documentation labels Mar 21, 2022
@alice-i-cecile
Copy link
Member

This feels like it could be useful externally, but I'm not confident enough in the design. If we keep it, it should have a proper example demonstrating its use.

Punting this question to @aclysma, the original author of the code in #437.

@alice-i-cecile alice-i-cecile added the C-Docs An addition or correction to our documentation label Mar 21, 2022
@mockersf
Copy link
Member

My usual stance to something never used in Bevy is "remove it, see if someone complains on the PR"...
Then, if someone says it's useful, open a PR to add an example maybe.

In this case, this is very hard to discover, not obvious how to use, no example, and never came up on discord so... 🗑️

@MiniaczQ
Copy link
Contributor Author

The usage is pretty simple, its a stripped down async barrier primitive, where counting and awaiting is separated. Not sure where I'd use it though.

@mockersf
Copy link
Member

it's "pretty simple" but it's unlike anything else in Bevy. And I wouldn't call anything using async in rust "pretty simple" to be fair...

@aclysma
Copy link
Contributor

aclysma commented Mar 22, 2022

This sync primitive is equivalent to the one discussed in this GDC talk, see at 16:50 for an example: https://www.gdcvault.com/play/1022186/Parallelizing-the-Naughty-Dog-Engine

It is broadly useful for scatter/gather workloads which are typical in games. TaskPool::scope() could also be used in some cases, but has a different tradeoff for flexibility/safety/ease-of-use.

I think the most common case of wanting this would be to jobify existing code where, for whatever reason, the more rigid but safer callback-based approach of TaskPool::scope() is unsuitable. Two cases come to mind: satisfying borrow-checking rules, or deferring the await to some time later.

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Mar 22, 2022

Thanks for the explanation. It sounds like this could definitely be useful, but if so it deserves proper docs demonstrating usage and tradeoffs, likely in the form of a complete example.

bors bot pushed a commit that referenced this issue Apr 26, 2022
# Objective

Fixes:
#4287 

## Solution

I removed it.
bors bot pushed a commit that referenced this issue Apr 26, 2022
# Objective

Fixes:
#4287 

## Solution

I removed it.
@bors bors bot closed this as completed in 4e547de Apr 26, 2022
exjam pushed a commit to exjam/bevy that referenced this issue May 22, 2022
# Objective

Fixes:
bevyengine#4287 

## Solution

I removed it.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

Fixes:
bevyengine#4287 

## Solution

I removed it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Tasks Tools for parallel and async work C-Code-Quality A section of code that is hard to understand or change C-Docs An addition or correction to our documentation
Projects
None yet
Development

No branches or pull requests

4 participants