-
Notifications
You must be signed in to change notification settings - Fork 343
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
Move ownership of metrics and limitEnforcer to the api type. #3034
Conversation
All contributors have signed the CLA ✍️ ✅ |
ee2b913
to
e347c69
Compare
e347c69
to
6dd801a
Compare
Currently ownership is shared even though the Isolate class encapsulates the api class. Moving complete ownership to the underlying api class allows the isolate class to be constructed in a different scope to the api class. This is useful for preinitialization of the api class before a request has come in.
6dd801a
to
a9fd4fc
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.
Nice! Ownership changes look good. One tiny change seems to be to when we call customizeIsolate
, but that likely isn't problematic. So LGTM!
jsgIsolate.runInLockScope( | ||
[&](JsgWorkerdIsolate::Lock& lock) { limitEnforcer->customizeIsolate(lock.v8Isolate); }); |
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.
In the previous version of the code this is run under jsg::runInV8Stack
, I assume doing this here under runInLockScope
is equivalent.
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.
Yeah, it's a utility function that translates to the same thing :)
Yep you're right, that change is indeed intended, we're going to be using this isolate before we have an |
Enable const variants of some const-safe jsg functions.
Move ownership of metrics and limitEnforcer to the api type.
This PR has no real function and should not change anything of itself.
Instead it's just another part of the work to enable python isolate pools.
This PR does some cleanup that will later enable us to create an isolate without the data that only becomes available once we have a request.
There is also a corresponding internal PR 9105