c

io.scalajs.nodejs.process

ProcessExtensions

implicit final class ProcessExtensions extends AnyVal

Process Object Extensions

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

Instance Constructors

  1. new ProcessExtensions(process: Process)

    process

    the given process

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  7. 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

    Since

    0.11.12

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

    Since

    0.7.7

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

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

    Since

    0.1.7

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

    0.5.10

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

  12. def onSIGBREAK(listener: () => Any): Process
  13. def onSIGBUS(listener: () => Any): Process
  14. def onSIGFPE(listener: () => Any): Process
  15. def onSIGHUP(listener: () => Any): Process
  16. def onSIGILL(listener: () => Any): Process
  17. 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

  18. def onSIGSEGV(listener: () => Any): Process
  19. def onSIGTERM(listener: () => Any): Process
  20. 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

  21. def onSIGWINCH(listener: () => Any): Process
  22. 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

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

  24. def onWarning(listener: (Warning) => 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

  25. def sendFuture(message: Any): Future[Boolean]
    Annotations
    @inline()
  26. def sendFuture(message: Any, sendHandle: SendHandle): Future[Boolean]
    Annotations
    @inline()
  27. def sendFuture(message: Any, sendHandle: SendHandle, options: TransferOptions): Future[Boolean]
    Annotations
    @inline()
  28. def toString(): String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped