-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Merged by Bors] - SystemState usage docs #3783
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, few typos and suggestions and after that I'll send approval!
@TheRawMeatball, the caching example is rather involved (relevant to discussion in #3774). I think I can get it working with a resource scope, but this pattern is clearly suboptimal. |
Hm, resource_scope is how I do the caching usually, but given the boilerplate associated I agree we could make it better. I'd use resource_scope for now, and we can make a better API for this later. |
1ef93dc
to
de3ffe9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks excellent and I will already Approve, but positing one question: Should there be a quick passage on why resource scope might be desirable in certain situations?
Maybe not necessary, just thought I would bring it up anyway.
It's probably slightly faster in general, and can be clearer / less verbose. I don't think it's worth including without benchmarks that are outside of the scope of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That helped quite a lot, thanks for the docs @alice-i-cecile!
bors r+ |
# Objective - `SystemStates` rock for dealing with exclusive world access, but are hard to figure out how to use. - Fixes #3341. ## Solution - Clearly document how to use `SystemState`, and why they're useful as an end-user.
Objective
SystemStates
rock for dealing with exclusive world access, but are hard to figure out how to use.World
#3341.Solution
SystemState
, and why they're useful as an end-user.