<!DOCTYPE html>
<html lang="en">
  <head>
    <title>DiscordRateLimiter Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Class/DiscordRateLimiter" class="dashAnchor"></a>

    <a title="DiscordRateLimiter Class Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          SwiftDiscord Docs
        </a>
         (100% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html">SwiftDiscord Reference</a>
      <img class="carat" src="../img/carat.png" />
      DiscordRateLimiter Class Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Guides.html">Guides</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../getting-started.html">Getting Started</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../installing-swiftdiscord-for-ios.html">Installing SwiftDiscord for iOS</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordAuditLog.html">DiscordAuditLog</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordBufferedVoiceDataSource.html">DiscordBufferedVoiceDataSource</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordClient.html">DiscordClient</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordEncoderMiddleware.html">DiscordEncoderMiddleware</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordEngine.html">DiscordEngine</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordGuild.html">DiscordGuild</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordLazyValue.html">DiscordLazyValue</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordOpusDecoder.html">DiscordOpusDecoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordOpusEncoder.html">DiscordOpusEncoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordRateLimiter.html">DiscordRateLimiter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordShardManager.html">DiscordShardManager</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordSilenceVoiceDataSource.html">DiscordSilenceVoiceDataSource</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordVoiceEngine.html">DiscordVoiceEngine</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordVoiceFileDataSource.html">DiscordVoiceFileDataSource</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordVoiceManager.html">DiscordVoiceManager</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DiscordVoiceSessionDecoder.html">DiscordVoiceSessionDecoder</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordActivityType.html">DiscordActivityType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordAuditLogActionType.html">DiscordAuditLogActionType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordChannelType.html">DiscordChannelType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordClientOption.html">DiscordClientOption</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordDispatchEvent.html">DiscordDispatchEvent</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordEndpoint.html">DiscordEndpoint</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordEndpoint/EndpointRequest.html">– EndpointRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordEndpoint/Options.html">– Options</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordGatewayCloseReason.html">DiscordGatewayCloseReason</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordGatewayCode.html">DiscordGatewayCode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordGatewayPayloadData.html">DiscordGatewayPayloadData</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordHeader.html">DiscordHeader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordLogLevel.html">DiscordLogLevel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordNormalGatewayCode.html">DiscordNormalGatewayCode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordOAuthEndpoint.html">DiscordOAuthEndpoint</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordPermissionOverwriteType.html">DiscordPermissionOverwriteType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordPresenceStatus.html">DiscordPresenceStatus</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordVoiceDataSourceStatus.html">DiscordVoiceDataSourceStatus</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordVoiceError.html">DiscordVoiceError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/DiscordVoiceGatewayCode.html">DiscordVoiceGatewayCode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/HTTPContent.html">HTTPContent</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordChannel.html">DiscordChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordClientDelegate.html">DiscordClientDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordClientHolder.html">DiscordClientHolder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordClientSpec.html">DiscordClientSpec</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordDispatchEventHandler.html">DiscordDispatchEventHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordEndpointConsumer.html">DiscordEndpointConsumer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordEngineHeartbeatable.html">DiscordEngineHeartbeatable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordEngineSpec.html">DiscordEngineSpec</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordGatewayable.html">DiscordGatewayable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordGuildChannel.html">DiscordGuildChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordLogger.html">DiscordLogger</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordOpusCodeable.html">DiscordOpusCodeable</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordRateLimiterSpec.html">DiscordRateLimiterSpec</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordShard.html">DiscordShard</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordShardDelegate.html">DiscordShardDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordShardManagerDelegate.html">DiscordShardManagerDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordTextChannel.html">DiscordTextChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordTokenBearer.html">DiscordTokenBearer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordUserActor.html">DiscordUserActor</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordVoiceDataSource.html">DiscordVoiceDataSource</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordVoiceEngineDelegate.html">DiscordVoiceEngineDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordVoiceEngineSpec.html">DiscordVoiceEngineSpec</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordVoiceManagerDelegate.html">DiscordVoiceManagerDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/DiscordWebSocketable.html">DiscordWebSocketable</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordActivity.html">DiscordActivity</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordActivityAssets.html">DiscordActivityAssets</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordActivityTimestamps.html">DiscordActivityTimestamps</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordAttachment.html">DiscordAttachment</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordAuditLogChange.html">DiscordAuditLogChange</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordAuditLogEntry.html">DiscordAuditLogEntry</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordBan.html">DiscordBan</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordDMChannel.html">DiscordDMChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed.html">DiscordEmbed</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed/Author.html">– Author</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed/Field.html">– Field</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed/Footer.html">– Footer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed/Image.html">– Image</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed/Provider.html">– Provider</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed/Thumbnail.html">– Thumbnail</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmbed/Video.html">– Video</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordEmoji.html">DiscordEmoji</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordFileUpload.html">DiscordFileUpload</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordGatewayPayload.html">DiscordGatewayPayload</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordGroupDMChannel.html">DiscordGroupDMChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordGuildChannelCategory.html">DiscordGuildChannelCategory</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordGuildMember.html">DiscordGuildMember</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordGuildTextChannel.html">DiscordGuildTextChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordGuildVoiceChannel.html">DiscordGuildVoiceChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordInvite.html">DiscordInvite</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordInviteChannel.html">DiscordInviteChannel</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordInviteGuild.html">DiscordInviteGuild</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordLazyDictionary.html">DiscordLazyDictionary</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordLazyDictionaryIndex.html">DiscordLazyDictionaryIndex</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordMessage.html">DiscordMessage</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordMessage/MessageType.html">– MessageType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordMessage/MessageActivity.html">– MessageActivity</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordMessage/MessageApplication.html">– MessageApplication</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordOpusVoiceData.html">DiscordOpusVoiceData</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordParty.html">DiscordParty</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordPermission.html">DiscordPermission</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordPermissionOverwrite.html">DiscordPermissionOverwrite</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordPresence.html">DiscordPresence</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordPresenceUpdate.html">DiscordPresenceUpdate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordRateLimitKey.html">DiscordRateLimitKey</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordRateLimitKey/DiscordRateLimitURLParts.html">– DiscordRateLimitURLParts</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordRawVoiceData.html">DiscordRawVoiceData</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordReaction.html">DiscordReaction</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordRole.html">DiscordRole</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordShardInformation.html">DiscordShardInformation</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordShardInformation/ShardingError.html">– ShardingError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordToken.html">DiscordToken</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordUser.html">DiscordUser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordUserGuild.html">DiscordUserGuild</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordVoiceEngineConfiguration.html">DiscordVoiceEngineConfiguration</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordVoiceServerInformation.html">DiscordVoiceServerInformation</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordVoiceState.html">DiscordVoiceState</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/DiscordWebhook.html">DiscordWebhook</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Snowflake.html">Snowflake</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord12AttachmentIDa">AttachmentID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord9ChannelIDa">ChannelID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord7EmojiIDa">EmojiID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord7GuildIDa">GuildID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord13IntegrationIDa">IntegrationID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord9MessageIDa">MessageID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord11OverwriteIDa">OverwriteID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord6RoleIDa">RoleID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord6UserIDa">UserID</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:12SwiftDiscord9WebhookIDa">WebhookID</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content">
            <h1>DiscordRateLimiter</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">DiscordRateLimiter</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/DiscordRateLimiterSpec.html">DiscordRateLimiterSpec</a></span></code></pre>

                </div>
              </div>
            <p>The DiscordRateLimiter is in charge of making sure we don&rsquo;t flood Discord with requests.
It keeps a dictionary of DiscordRateLimitKeys and DiscordRateLimits.
All requests to the REST api should be routed through the DiscordRateLimiter.
If a DiscordRateLimit determines we have hit a limit, we add the request and its callback to the limit&rsquo;s queue.
After that it is up to the DiscordRateLimit to decide when to make the request.
TODO handle the global rate limit</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:12SwiftDiscord0B11RateLimiterC13callbackQueueSo17OS_dispatch_queueCvp"></a>
                    <a name="//apple_ref/swift/Property/callbackQueue" class="dashAnchor"></a>
                    <a class="token" href="#/s:12SwiftDiscord0B11RateLimiterC13callbackQueueSo17OS_dispatch_queueCvp">callbackQueue</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The queue that request responses are called on.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">callbackQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:12SwiftDiscord0B11RateLimiterC8failFastSbvp"></a>
                    <a name="//apple_ref/swift/Property/failFast" class="dashAnchor"></a>
                    <a class="token" href="#/s:12SwiftDiscord0B11RateLimiterC8failFastSbvp">failFast</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Whether or not this rate limiter should immediately callback on rate limits.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">failFast</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Initializers"></a>
                <a name="//apple_ref/swift/Section/Initializers" class="dashAnchor"></a>
                <a href="#/Initializers">
                  <h3 class="section-name">Initializers</h3>
                </a>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:12SwiftDiscord0B11RateLimiterC13callbackQueue8failFastACSo17OS_dispatch_queueC_Sbtcfc"></a>
                    <a name="//apple_ref/swift/Method/init(callbackQueue:failFast:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:12SwiftDiscord0B11RateLimiterC13callbackQueue8failFastACSo17OS_dispatch_queueC_Sbtcfc">init(callbackQueue:failFast:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Creates a new DiscordRateLimiter with the specified callback queue.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">callbackQueue</span><span class="p">:</span> <span class="kt">DispatchQueue</span><span class="p">,</span> <span class="nv">failFast</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Methods"></a>
                <a name="//apple_ref/swift/Section/Methods" class="dashAnchor"></a>
                <a href="#/Methods">
                  <h3 class="section-name">Methods</h3>
                </a>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:12SwiftDiscord0B11RateLimiterC14executeRequest_3for8callbacky10Foundation10URLRequestV_AA0bC8LimitKeyVyAG4DataVSg_So17NSHTTPURLResponseCSgs5Error_pSgtctF"></a>
                    <a name="//apple_ref/swift/Method/executeRequest(_:for:callback:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:12SwiftDiscord0B11RateLimiterC14executeRequest_3for8callbacky10Foundation10URLRequestV_AA0bC8LimitKeyVyAG4DataVSg_So17NSHTTPURLResponseCSgs5Error_pSgtctF">executeRequest(_:for:callback:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Executes a request through the rate limiter. If the rate limit is hit, the request is put in a queue
and executed later.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">executeRequest</span><span class="p">(</span><span class="n">_</span> <span class="nv">request</span><span class="p">:</span> <span class="kt">URLRequest</span><span class="p">,</span> <span class="k">for</span> <span class="nv">endpointKey</span><span class="p">:</span> <span class="kt"><a href="../Structs/DiscordRateLimitKey.html">DiscordRateLimitKey</a></span><span class="p">,</span>
                           <span class="nv">callback</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">Data</span><span class="p">?,</span> <span class="kt">HTTPURLResponse</span><span class="p">?,</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="p">())</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The request to execute.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>for</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The endpoint key.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>callback</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The callback for this request.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:12SwiftDiscord0B11RateLimiterC14executeRequest8endpoint5token11requestInfo8callbackyAA0B8EndpointO_AA0B5TokenVAJ0lF0Oy10Foundation4DataVSg_So17NSHTTPURLResponseCSgs5Error_pSgtctF"></a>
                    <a name="//apple_ref/swift/Method/executeRequest(endpoint:token:requestInfo:callback:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:12SwiftDiscord0B11RateLimiterC14executeRequest8endpoint5token11requestInfo8callbackyAA0B8EndpointO_AA0B5TokenVAJ0lF0Oy10Foundation4DataVSg_So17NSHTTPURLResponseCSgs5Error_pSgtctF">executeRequest(endpoint:token:requestInfo:callback:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Executes a request through the rate limiter. If the rate limit is hit, the request is put in a queue
and executed later.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">executeRequest</span><span class="p">(</span><span class="nv">endpoint</span><span class="p">:</span> <span class="kt"><a href="../Enums/DiscordEndpoint.html">DiscordEndpoint</a></span><span class="p">,</span>
                           <span class="nv">token</span><span class="p">:</span> <span class="kt"><a href="../Structs/DiscordToken.html">DiscordToken</a></span><span class="p">,</span>
                           <span class="nv">requestInfo</span><span class="p">:</span> <span class="kt"><a href="../Enums/DiscordEndpoint.html">DiscordEndpoint</a></span><span class="o">.</span><span class="kt">EndpointRequest</span><span class="p">,</span>
                           <span class="nv">callback</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">Data</span><span class="p">?,</span> <span class="kt">HTTPURLResponse</span><span class="p">?,</span> <span class="kt">Error</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="p">())</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>endpoint</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The endpoint for this request.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>token</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The token to use in this request.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>requestInfo</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A <code><a href="../Enums/DiscordEndpoint/EndpointRequest.html">DiscordEndpoint.EndpointRequest</a></code> specifying the request info.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>callback</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The callback for this request.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2018 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2018-06-21)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
