I know it's possible to send SIGTERM
, SIGINT
, etc. to your own process in the C programming language:
https://www.gnu.org/software/libc/manual/html_node/Signaling-Yourself.html
Does Node.js provide this functionality?
Node. js is a single-threaded, open-source, cross-platform runtime environment for building fast and scalable server-side and networking applications. It runs on the V8 JavaScript runtime engine, and it uses event-driven, non-blocking I/O architecture, which makes it efficient and suitable for real-time applications.
Not Suitable for Heavy-Computing Apps Node. js doesn't support multi-threaded programming yet. It is able to serve way more complicated applications than Ruby, but it's not suitable for performing long-running calculations. Heavy computations block the incoming requests, which can lead to decrease of performance .
Since Node. js uses non-blocking IO, the server can handle multiple requests without waiting for each one to complete, which means Node. js can handle a much higher volume of web traffic than other more traditional languages.
For a beginner who wants to get started in the tech industry, learning Node. js and getting relevant certifications can be an effective way to get your career launched. Use the advice above to start your journey, and soon you'll be proficient in this popular (and profitable) runtime environment.
process.kill(process.pid, "SIGINT");
process.kill
sends a signal (SIGINT
in this case, provided by the second parameter), to a provided PID. (process.pid
in this case, which is the PID of the running node process.)
Source: https://nodejs.org/api/process.html#process_process_kill_pid_signal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With