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

Fix watch command #2

Open
wants to merge 1 commit into
base: multi-thread-compiler
Choose a base branch
from

Conversation

corollari
Copy link

The changes made in your PR break the watch command, which is used by serverless-offline. This PR fixes it.

Thanks for the PR btw, it helped a lot :D

@corollari
Copy link
Author

@soda0289 thoughts?

@soda0289
Copy link
Owner

Thanks for pushing a fix. I haven't touched this change in a while, been busy with work. Give me some time later today to test this out.

@corollari
Copy link
Author

I've been thinking more about this and I think we might be able to avoid the serialization requirement (which breaks configs that include functions) by using the fork() syscall.

Turns out that sycalls are a little bit difficult to call from node (child_process.fork() doesn't actually call fork :/), but here's a short snippet where I managed to get them working:

const libsys = require('libsys');
 
b = libsys.syscall(57);

console.log(b) // 0 for child and pid for parent

Note that I took the number 57 from the linux kernel code, so it might not work correctly on Mac (actually I'm not sure if there's any non-backwards-compatible changes on that API that could break this code on older versions of the linux kernel).

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.

2 participants