uloop. signal

Represents a uloop signal Unix process signal handler as returned by signal().

Example
const sighandler = uloop.signal(…);

sighandler.signo();
sighandler.delete();

Methods

delete() → {boolean}

Uninstalls the signal handler.

This method uninstalls the signal handler, restoring the previous or default handler for the signal, and releasing any associated resources.

Returns: boolean

Returns true on success.

Example
// Uninstall the signal handler and restore the previous/default handler
const sighandler = uloop.signal(…);
sighandler.delete();

signo() → {number}

Returns the associated signal number.

This method returns the signal number that this uloop signal handler is configured to respond to.

Returns: number

The signal number that this handler is responding to.

Example
// Get the signal number that the uloop signal handler is responding to
const sighandler = uloop.signal("SIGINT", () => printf("Cought INT\n"));
printf("Signal number: %d\n", sighandler.signo());