Skip to main content
Version: 2.4

Process

Index

Constructors

constructor

Methods

staticonHealthCheck

  • onHealthCheck(callback: () => Promise<string>): () => void
  • Static method to register a callback that is used to check the health status of the process. This is typically used by kubernetes environment to maintain backend healthy

    The callback must return a Promise which returns a string as valid message. The process is considered by the runtime as unhealthy if the promise is rejected.


    Parameters

    • callback: () => Promise<string>

      the callback executed each time the runtime check the health of the process.

    Returns () => void

      • (): void
      • Static method to register a callback that is used to check the health status of the process. This is typically used by kubernetes environment to maintain backend healthy

        The callback must return a Promise which returns a string as valid message. The process is considered by the runtime as unhealthy if the promise is rejected.


        Returns void

staticonShutdown

  • onShutdown(callback: () => Promise<void>): () => void
  • Static method to register a callback called by the runtime when it receives the signal to be terminated. This is typically used to graceful shutdown some connections or drivers to external processes.

    The callback must return a Promise which is resolved when the shutdown process is done.


    Parameters

    • callback: () => Promise<void>

      the callback executed when the runtime terminates.

    Returns () => void

      • (): void
      • Static method to register a callback called by the runtime when it receives the signal to be terminated. This is typically used to graceful shutdown some connections or drivers to external processes.

        The callback must return a Promise which is resolved when the shutdown process is done.


        Returns void