-
Notifications
You must be signed in to change notification settings - Fork 630
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
feat(node/cluster): cluster
module for Node compat
#2271
Conversation
@cmorten are there any blockers for this PR? |
The cluster module is basically there but it relies on Guess similar to denoland/deno#12879 |
Hmm maybe https://github.com/denoland/deno/pull/13566… worst case can tidy up with some |
node/_tools/test.ts
Outdated
@@ -57,7 +57,7 @@ for await (const path of testPaths) { | |||
"--unstable", | |||
"--no-check", | |||
"--v8-flags=" + v8Flags.join(), | |||
requireTs, | |||
"--compat", |
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.
Required to avoid errors with forked processes which start complaining because of the .ts
extension - would need the require helper file to be .mjs
for it to work... or just use --compat
here (which opted for).
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.
I prefer .mjs
here. It's more important to check that non-compat deno can consume std/node
correctly in my view
@cmorten Can you somehow get rid of circular dependency of (circular dependency can be checked with the command |
Yeah aware 😅 Had tried but it’s not a simple one to fix… suspect might have to deviate somewhat from the Node file structure, but haven’t had time recently to try and attack! Will put this back in draft in the meantime as it’s not ready without this solved. |
Hi @cmorten, is there anything we can do to progress this PR? If you cannot do so, I'm sure someone will be happy to take it on. |
Hey @iuioiua 👋 Sorry for slow reply! Unfortunately been a matter of time (and then forgetting) that haven’t got around to finishing this off 😅. Unfortunately I don’t expect this will change in the coming weeks. If anyone is wanting to progress or throw away these changes then please do (I seem to be making a habit with this, same happened when I implement IIRC the only blocker when I left it was circular deps as a result of being largely uninventive and mirroring the node implementation. |
@cmorten, are you able to enable some native cluster-related Node tests? I'm curious whether they're affected while circular dependencies are present. The contribution guide is in |
`Deno.chmod()` is async
Hi @cmorten, is this PR ready for review? CI is green 👍🏾 |
Yep all good to go |
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.
Great progress in node compatibility! Thank you for your contribution! @cmorten
Wow, this was a lot of work. Great to see that it finally landed. Incredible job @cmorten! |
Implements majority
cluster
module for Node compat.Tests and full functionality not implemented owing to missing:
process.send()
- https://nodejs.org/api/process.html#processsendmessage-sendhandle-options-callbackprocess.connected
- https://nodejs.org/api/process.html#processconnectedprocess.on("message")
- https://nodejs.org/api/process.html#event-messageprocess.on("disconnect")
- https://nodejs.org/api/process.html#event-disconnectChildProcess.prototype.send()
- https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callbackChildProcess.prototype.connected
- https://nodejs.org/api/child_process.html#subprocessconnecteddomain.create
- https://nodejs.org/api/domain.html#domaincreateWhich are likely blocked by denoland/deno#13566 so can be implemented in a follow-up.