implicit final class ProcessExtensions extends AnyVal
Process Object Extensions
- Alphabetic
- By Inheritance
- ProcessExtensions
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def onBeforeExit(listener: (ExitCode) => Any): Process
This event is emitted when Node.js empties its event loop and has nothing else to schedule.
This event is emitted when Node.js empties its event loop and has nothing else to schedule. Normally, Node.js exits when there is no work scheduled, but a listener for 'beforeExit' can make asynchronous calls, and cause Node.js to continue.
'beforeExit' is not emitted for conditions causing explicit termination, such as process.exit() or uncaught exceptions, and should not be used as an alternative to the 'exit' event unless the intention is to schedule more work.
- listener
the event listener function
- Annotations
- @inline()
- Since
0.11.12
- def onDisconnect(listener: () => Any): Process
If process is spawned with an IPC channel, 'disconnect' will be emitted when IPC channel is closed.
If process is spawned with an IPC channel, 'disconnect' will be emitted when IPC channel is closed. Read more in child_process 'disconnect' event doc.
- listener
the event listener function
- Annotations
- @inline()
- Since
0.7.7
- def onExit(listener: (ExitCode) => Any): Process
Emitted when the process is about to exit.
Emitted when the process is about to exit. There is no way to prevent the exiting of the event loop at this point, and once all 'exit' listeners have finished running the process will exit. Therefore you must only perform synchronous operations in this handler. This is a good hook to perform checks on the module's state (like for unit tests). The callback takes one argument, the code the process is exiting with.
- listener
the event listener function
- Annotations
- @inline()
process.on('exit', (code) => { ... })
- Since
0.1.7
Example: - def onMessage(listener: (Any, UndefOr[|[Server, Socket]]) => Any): Process
Messages sent by ChildProcess.send() are obtained using the 'message' event on the child's process object.
Messages sent by ChildProcess.send() are obtained using the 'message' event on the child's process object.
- listener
the event listener function
- message: <Object> a parsed JSON object or primitive value
- sendHandle: <Handle object> a net.Socket or net.Server object, or undefined.
- Annotations
- @inline()
- Since
0.5.10
- def onMultipleResolves[T](listener: (String, Promise[T], Any) => Any): Process
- Annotations
- @inline()
- def onRejectionHandled[T](listener: (Promise[T]) => Any): Process
Emitted whenever a Promise was rejected and an error handler was attached to it (for example with promise.catch()) later than after an event loop turn.
Emitted whenever a Promise was rejected and an error handler was attached to it (for example with promise.catch()) later than after an event loop turn.
- listener
the event listener function
- Annotations
- @inline()
- def onSIGBREAK(listener: () => Any): Process
- Annotations
- @inline()
- def onSIGBUS(listener: () => Any): Process
- Annotations
- @inline()
- def onSIGFPE(listener: () => Any): Process
- Annotations
- @inline()
- def onSIGHUP(listener: () => Any): Process
- Annotations
- @inline()
- def onSIGILL(listener: () => Any): Process
- Annotations
- @inline()
- def onSIGINT(listener: () => Any): Process
An easy way to send the SIGINT signal is with Control-C in most terminal programs.
An easy way to send the SIGINT signal is with Control-C in most terminal programs.
- listener
the event listener function
- Annotations
- @inline()
- def onSIGSEGV(listener: () => Any): Process
- Annotations
- @inline()
- def onSIGTERM(listener: () => Any): Process
- Annotations
- @inline()
- def onSIGUSR1(listener: () => Any): Process
SIGUSR1 is reserved by Node.js to start the debugger.
SIGUSR1 is reserved by Node.js to start the debugger. It's possible to install a listener but that won't stop the debugger from starting.
- listener
the event listener function
- Annotations
- @inline()
- def onSIGWINCH(listener: () => Any): Process
- Annotations
- @inline()
- def onUncaughtException(listener: (Error, String) => Any): Process
- Annotations
- @inline()
- def onUncaughtException(listener: (Error) => Any): Process
The 'uncaughtException' event is emitted when an exception bubbles all the way back to the event loop.
The 'uncaughtException' event is emitted when an exception bubbles all the way back to the event loop. By default, Node.js handles such exceptions by printing the stack trace to stderr and exiting. Adding a handler for the 'uncaughtException' event overrides this default behavior.
- listener
the event listener function
- Annotations
- @inline()
- def onUnhandledRejection[T](listener: (Any, Promise[T]) => Any): Process
Emitted whenever a Promise is rejected and no error handler is attached to the promise within a turn of the event loop.
Emitted whenever a Promise is rejected and no error handler is attached to the promise within a turn of the event loop. When programming with promises exceptions are encapsulated as rejected promises. Such promises can be caught and handled using promise.catch() and rejections are propagated through a promise chain. This event is useful for detecting and keeping track of promises that were rejected whose rejections were not handled yet.
- listener
the event listener function
- Annotations
- @inline()
- def onWarning(listener: (Error) => Any): Process
A process warning is similar to an error in that it describes exceptional conditions that are being brought to the user's attention.
A process warning is similar to an error in that it describes exceptional conditions that are being brought to the user's attention. However, warnings are not part of the normal Node.js and JavaScript error handling flow. Node.js can emit warnings whenever it detects bad coding practices that could lead to sub-optimal application performance, bugs or security vulnerabilities.
The event handler for 'warning' events is called with a single warning argument whose value is an Error object.
- listener
the event listener function
- Annotations
- @inline()
- def sendFuture(message: Any): Future[Boolean]
- Annotations
- @inline()
- def sendFuture(message: Any, sendHandle: SendHandle): Future[Boolean]
- Annotations
- @inline()
- def sendFuture(message: Any, sendHandle: SendHandle, options: TransferOptions): Future[Boolean]
- Annotations
- @inline()
- def toString(): String
- Definition Classes
- Any