concept signal in category javascript

appears as: signals, signals, signal
Node.js in Practice

This is an excerpt from Manning's book Node.js in Practice.

Technique 11 Responding to signals

Node programs can respond to signals sent by other processes.

It’s important to realize that signals can be sent from any process to any other, permissions notwithstanding. Your Node process can send another process a signal by using process.kill(pid, [signal])—in this case kill doesn’t mean the process will be “killed,” but simply sent a given signal. The method is named kill after the C standard library function in signal.h.

Figure 2.3 shows a broad overview of how signals originate from any process in an operating system and can be received by your Node processes.

Figure 2.3. Signals originate from a process, and are handled with an event listener.

You don’t have to respond to signals in your Node programs, but if you’re writing a long-running network server, then signal listeners can be extremely useful. Supporting signals like SIGHUP will make your program fit into existing systems more naturally.

sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest