Iskra API Reference
    Preparing search index...

    Class ProcessManager

    Implements

    Index
    name: string = 'ProcessManager'
    • Parameters

      Returns void

    • Gracefully stop and remove a single named process. Sends SIGTERM, then escalates to SIGKILL after gracefulTimeoutMs. The worst-case wait before this method resolves is gracefulTimeoutMs * 2: gracefulTimeoutMs for the SIGKILL escalation plus another gracefulTimeoutMs grace window for the process to actually exit afterwards. If the process still has not exited by then, it is reported as an orphan via app.logger.error.

      Parameters

      • name: string
      • gracefulTimeoutMs: number = 5000

      Returns Promise<void>

      if no process with the given name exists.

    • Writes data to a stdio process's stdin as one line: an object is JSON-encoded, a string is written as is. Resolves to false, with a warning, when the message is not sent: no such process, not in stdio mode, a string with a line break, or a child that has not read what it was sent (see ProcessConfig.maxPendingStdinBytes).

      Parameters

      • name: string
      • data: unknown

      Returns Promise<boolean>

    • Spawn and register a new process at runtime. Reuses the existing internal spawn logic and respects the process mode (stdio/daemon/oneshot).

      Parameters

      Returns Promise<void>

      if the manager is not registered on an App or has been stopped, if a process with the given name is already registered, or if it cannot be spawned (e.g. the command does not exist).

    • Returns Promise<void>

    • Parameters

      • gracefulTimeoutMs: number = 5000

      Returns Promise<void>