disvite
    Preparing search index...

    Class GuildTaskQueue

    Serialized per-guild asynchronous task queue. Guarantees FIFO execution of join reconciliation tasks per guild to prevent REST rate limits and race conditions during high-volume join storms.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • get activeGuilds(): number

      Returns the number of guilds currently running or waiting on queued tasks.

      Returns number

    Methods

    • Enqueue a task for a specific guild. Tasks for the same guild are executed sequentially, while tasks for different guilds run concurrently.

      Type Parameters

      • T

      Parameters

      • guildId: string

        The guild identifier.

      • task: () => Promise<T>

        The async callback to execute.

      Returns Promise<T>

      The resolved value of the task.

    • Get the number of pending tasks for a specific guild.

      Parameters

      • guildId: string

      Returns number