-
Notifications
You must be signed in to change notification settings - Fork 449
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
refactor: make resourceScope and Resource.use inline #3515
Conversation
I've opted for the `allocateResourceScope` approach to limit the API exposure via `@PublishedAPI` to a minimum
side note - seems like arrow.fx.coroutines.RaceNJvmTest#firstRacerOutOf2AlwaysWinsOnASingleThread is not stable |
I'm not very sure about this change for a couple of reasons:
|
I'm inclined to agree on the first point - however it's not a huge amount worse than the inline implementations of I've actually missed the purpose of making I'll look into refactoring the finalize handling into Regarding the block not being |
I've been thinking more and more about this, and I'm increasingly convinced that we may get problems out of this. My reasoning is that we want |
Finally blocks are triggered upon non-local return:
so I think we're fine |
Indeed, that was the purpose of moving the I was going to raise a separate PR to attend to the fact the I've also noticed when looking into this last night that the |
Do you mind doing this in the same PR? I think it's easier to understand the changes to this behavior in a single view than in smaller PRs. |
The only signficant change to the actual implementation of resourceScope is the shift of the In order to reduce the amount of code that is inlined or exposed in the API snapshots (and therefore requires consistency between versions) I opted to introduce the |
@serras a non-local return can't happen in a release function because they're stored in a list (and hence are never |
Superseded by #3518 |
I've opted for the
allocateResourceScope
approach to limit the API exposure via@PublishedAPI
to a minimum