Skip to content

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