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

How to use --wait-ready for non node-js programs ? #5775

Open
deepakg202 opened this issue Feb 24, 2024 · 1 comment
Open

How to use --wait-ready for non node-js programs ? #5775

deepakg202 opened this issue Feb 24, 2024 · 1 comment

Comments

@deepakg202
Copy link

I have a web server in dart which takes some time to start. How do i call process.send('ready') from the dart program ?

Currently I am using a workaround of running a nodejs file which is a wrapper to run the dart server and calling process.send from there. Is there any better way of doing this ?

@ultimate-tester
Copy link

So pm2 would be a manager for NodeJS, not for other application types. It can probably be abused to make your use case work, but that doesn't mean it's supported. With this I'm trying to say: find something specific for Dart.

Having said that, the process.send method uses an IPC channel to communicate to its parent (if any). Dart does not have cross OS IPC so you'd need to find or make your own implementation. If your target OS is Linux, you go with Domain Sockets and if your OS is windows you go with named pipes.

Where the domain socket is located or what is the name of the named pipe for NodeJS I'm not sure. You'll need to hijack it and then mimic the process.send method that way to accomplish what you want.

But again, you should find a different solution than PM2 for dart applications.

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

No branches or pull requests

2 participants