Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LocalBucket Protected

Bucket used for saving ratelimits

Hierarchy

  • LocalBucket

Index

Constructors

  • Create a new bucket

    Parameters

    • ratelimiter: <internal>.Ratelimiter

      ratelimiter used for ratelimiting requests

    • routeKey: string

      Key used internally to routify requests. Assigned by ratelimiter

    Returns <internal>.LocalBucket

Properties

fnQueue: { callback: any; fn: any }[]

array of functions waiting to be executed

limit: number

Number of functions that may be executed during the timeframe set in limitReset

ratelimiter: <internal>.Ratelimiter

ratelimiter used for ratelimiting requests

remaining: number

Remaining amount of executions during the current timeframe

reset: number

Timeframe in milliseconds until the ratelimit resets

resetRemaining: any

Reset the remaining tokens to the base limit

resetTimeout: null | Timeout

Timeout that calls the reset function once the timeframe passed

routeKey: string

Key used internally to routify requests

default: typeof <internal>.LocalBucket

Methods

  • checkQueue(): void
  • Check if there are any functions in the queue that haven't been executed yet

    Returns void

  • dropQueue(): void
  • Clear the current queue of events to be sent

    Returns void

Generated using TypeDoc