Menu

Reference / Async

dumpOn()

function
function dumpOn(int ...$signals): void

Print dump() to STDERR whenever one of $signals arrives.

Go's SIGQUIT-dumps-every-goroutine, for interrogating a process that is already hung and cannot be restarted. SIGQUIT is the natural choice. The handler runs as ordinary async code (a daemon task), so the report is a consistent snapshot.

Async\async(function () {
    Async\dumpOn(SIGQUIT);      // then: kill -QUIT <pid>
    serveForever();
});

Parameters

...$signals int
the signal numbers, e.g. SIGQUIT

See also: dump, shutdownOn

View source