public void DestroyGuildBucket(GuildBucket type, ulong guildId) { //Assume this object is locked RequestQueueBucket bucket; _guildBuckets[(int)type].TryRemove(guildId, out bucket); }
public Task SendGatewayAsync(GatewayOpCode opCode, object payload, GuildBucket bucket, ulong guildId, RequestOptions options = null) => SendGatewayInternalAsync(opCode, payload, BucketGroup.Guild, (int)bucket, guildId, options);
public static Bucket GetBucketInfo(GuildBucket bucket) => _guildLimits[bucket];
private RequestQueueBucket GetGuildBucket(GuildBucket type, ulong guildId) { return(_guildBuckets[(int)type].GetOrAdd(guildId, _ => CreateBucket(_guildLimits[type]))); }
public Task <TResponse> SendRpcAsync <TResponse>(string cmd, object payload, GuildBucket bucket, ulong guildId, Optional <string> evt = default(Optional <string>), bool ignoreState = false, RequestOptions options = null) where TResponse : class => SendRpcAsyncInternal <TResponse>(cmd, payload, BucketGroup.Guild, (int)bucket, guildId, evt, ignoreState, options);