process

Current process (ub executable)

Members

# arch : string static

CPU architecture. Currently only x64

# binPath : string static

The full path to the UB executable

# configPath : String static

The path to the application configuration file

# env : Object.<string, string> static

Current process environment variables. Keys is variable names

# isDebug : number static

=== 1 if server executed with -dev command line switch

# isServer : Number static

For server-side thread === 1, else (client thread) === 0

# isWebSocketEnabled : Number static

When WebSocket is enabled === 1 else not defined

# isWebSocketServer : Number static

In case this is WebSocket server-side thread === 1 else not defined

# pid : number static

Current process ID. The meaning of the return value of this call is system dependent

# platform : string static

Current platform. nix for Linux, win32 for Windows (actually should be win64, but sets to win32 for node compatibility)

# startupMode : string static

The UB process startup mode. One of "Console", "CmdLine"

Methods

# kill (pidnumber, signaloptnumber) static

The process.kill() method sends the signal to the process identified by pid. *nix only. On Windows - do nothing.

Arguments:
  • pid: number

    A process ID

  • signal = 15: number

    The signal to send as a number. See kill -l for possible values Default is SIGTERM (15 on Linux)

# terminationRequested () → boolean static

Return true in case process should be terminated ASAP. Long-running jobs should call this function and stops if possible. See @unitybase/ubq/ubqMailJob.js for usage example