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

Workerd side of python isolate pool #2936

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Workerd side of python isolate pool #2936

merged 1 commit into from
Dec 9, 2024

Conversation

danlapid
Copy link
Collaborator

No description provided.

@danlapid danlapid changed the title [WIP] python isolate pool [DRAFT] [WIP] python isolate pool Oct 16, 2024
src/pyodide/BUILD.bazel Outdated Show resolved Hide resolved
@danlapid danlapid force-pushed the dlapid/python-pools2 branch 8 times, most recently from 7609106 to b3d8a00 Compare October 17, 2024 23:17
@@ -68,4 +68,8 @@ interface Module {
addRunDependency(x: string): void;
removeRunDependency(x: string): void;
noInitialRun: boolean;
setUnsafeEval(mod: typeof import('internal:unsafe-eval').default): void;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type imports must be here instead of an import statement because we use this file as an "ambient" type declaration.
See https://stackoverflow.com/questions/39040108/import-class-in-definition-file-d-ts

src/workerd/api/BUILD.bazel Outdated Show resolved Hide resolved
@danlapid danlapid force-pushed the dlapid/python-pools2 branch 2 times, most recently from 1deb2c2 to e4e608b Compare October 17, 2024 23:50
@danlapid danlapid force-pushed the dlapid/python-pools2 branch 8 times, most recently from bc1543a to 1a87fae Compare October 25, 2024 21:34
@danlapid danlapid force-pushed the dlapid/python-pools2 branch 2 times, most recently from 2e46939 to 05e7568 Compare October 30, 2024 23:36
@danlapid danlapid changed the base branch from main to dlapid/ownership_cleanups_for_pools October 30, 2024 23:38
src/workerd/io/worker.h Outdated Show resolved Hide resolved
@danlapid danlapid force-pushed the dlapid/python-pools2 branch 12 times, most recently from d166d95 to 97bfb3a Compare November 30, 2024 14:09
@danlapid danlapid force-pushed the dlapid/refactor_limitenforcer_workerobserver branch 5 times, most recently from 9a5a6ee to 550e085 Compare December 7, 2024 11:48
Base automatically changed from dlapid/refactor_limitenforcer_workerobserver to main December 7, 2024 12:25
@danlapid danlapid force-pushed the dlapid/python-pools2 branch 2 times, most recently from 9272eae to 7e32820 Compare December 7, 2024 13:39
Copy link

github-actions bot commented Dec 7, 2024

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot 🎉

@danlapid danlapid force-pushed the dlapid/python-pools2 branch from 7e32820 to d724cad Compare December 7, 2024 13:44
@danlapid danlapid closed this Dec 9, 2024
@danlapid danlapid force-pushed the dlapid/python-pools2 branch from d724cad to c876e52 Compare December 9, 2024 12:00
This commit moves the emscripten and pyodide initialization step to
the API constructor to enable creation of python isolate pools.
@danlapid danlapid reopened this Dec 9, 2024
@@ -490,7 +490,7 @@ jsg::JsValue SetupEmscripten::getModule(jsg::Lock& js) {
}

void SetupEmscripten::visitForGc(jsg::GcVisitor& visitor) {
visitor.visit(emscriptenRuntime.emscriptenRuntime);
visitor.visit(const_cast<EmscriptenRuntime&>(emscriptenRuntime).emscriptenRuntime);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: might be worth writing a comment why this cast is necessary and why it's safe

@danlapid danlapid merged commit 93a6037 into main Dec 9, 2024
16 of 17 checks passed
@danlapid danlapid deleted the dlapid/python-pools2 branch December 9, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants