Member Junction
    Preparing search index...

    QueueManager class is a generic manager of all active queues for the process.

    Whenever a new task is added, the queue manager will see if the TYPE of task already has a queue running or not. If that type of queue isn't running, it will start one up.

    Then, a new task is processed by logging into the database the new task and then it will be assigned to the queue that is responsible for processing that type of task.

    The queue manager is also responseible for updating all of its active Queues in the DB with heartbeat information. Heartbeat information is used to determine if a queue has crashed or not by other processes or not. After a heartbeat timeout is reached, other queues can pick up tasks from a crashed process.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Accessors

    • get GlobalKey(): string

      Returns string

    • get ShutdownName(): string

      Optional human-readable identifier surfaced in shutdown logs and used for de-duplication when Register is called repeatedly with the same instance but no name. Falls back to the constructor name.

      Returns string

    Methods

    • The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.

      Returns GlobalObjectStore

    • Release the resource. Must be idempotent — ShutdownAll() may be invoked more than once during a slow drain (e.g., SIGTERM followed by SIGINT). Should not throw; failures are logged and remaining shutdowns continue.

      Returns void

    • Stop every active queue. Idempotent. Wired to ShutdownRegistry so the SIGTERM/SIGINT handler can drain queues during graceful shutdown — without this, each QueueBase keeps setTimeout-pinning itself indefinitely.

      Returns void

    • Returns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.

      Type Parameters

      Parameters

      • this: new () => T
      • OptionalclassName: string

      Returns T