Class

io.scalajs.nodejs.Process

ProcessExtensions

Related Doc: package Process

Permalink

implicit final class ProcessExtensions extends AnyVal

Process Object Extensions

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProcessExtensions
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ProcessExtensions(process: Process)

    Permalink

    process

    the given process

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  7. def onBeforeExit(listener: Function): process.type

    Permalink

    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

    Since

    0.11.12

  8. def onDisconnect(listener: Function): process.type

    Permalink

    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

    Since

    0.7.7

  9. def onExit(listener: (ExitCode) ⇒ Any): process.type

    Permalink

    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

    Example:
    1. process.on('exit', (code) => { ... })

    Since

    0.1.7

  10. def onMessage(listener: Function): process.type

    Permalink

    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.
    Since

    0.5.10

  11. def onRejectionHandled(listener: Function): process.type

    Permalink

    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

  12. def onSIGINT(listener: () ⇒ Any): process.type

    Permalink

    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

  13. def onSIGUSR1(listener: () ⇒ Any): process.type

    Permalink

    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

  14. def onUncaughtException(listener: (Error) ⇒ Any): process.type

    Permalink

    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

  15. def onUnhandledRejection[T](listener: (String, Promise[T]) ⇒ Any): process.type

    Permalink

    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

  16. def onWarning(listener: (Warning) ⇒ Any): process.type

    Permalink

    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

  17. val process: Process

    Permalink

    the given process

  18. def sendFuture(message: Any): Promise[Boolean]

    Permalink

    Annotations
    @inline()
    See also

    Process.send()

  19. def sendFuture(message: Any, sendHandle: Any): Promise[Boolean]

    Permalink

    Annotations
    @inline()
    See also

    Process.send()

  20. def sendFuture(message: Any, sendHandle: Any, options: TransferOptions): Promise[Boolean]

    Permalink

    Annotations
    @inline()
    See also

    Process.send()

  21. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped