aegis.cpp
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Friends | List of all members
aegis::ratelimit::ratelimit_mgr Class Reference

Factory class for managing ratelimit bucket factory objects. More...

#include <ratelimit.hpp>

Public Member Functions

 ratelimit_mgr (rest_call call, asio::io_context &_io, core *_b)
 Construct a ratelimit_mgr object for managing the bucket factories. More...
 
 ratelimit_mgr (const ratelimit_mgr &)=delete
 
 ratelimit_mgr (ratelimit_mgr &&)=delete
 
ratelimit_mgroperator= (const ratelimit_mgr &)=delete
 
bool is_global () const noexcept
 Check if globally ratelimited. More...
 
bucketget_bucket (const std::string &path) noexcept
 Get a bucket object. More...
 
template<typename ResultType , typename V = std::enable_if_t<!std::is_same<ResultType, rest::rest_reply>::value>>
aegis::future< ResultType > post_task (rest::request_params params) noexcept
 
aegis::future< rest::rest_replypost_task (rest::request_params params) noexcept
 
template<typename ResultType , typename V = std::enable_if_t<!std::is_same<ResultType, rest::rest_reply>::value>>
aegis::future< ResultType > post_task (std::string _bucket, rest::request_params params) noexcept
 
aegis::future< rest::rest_replypost_task (std::string _bucket, rest::request_params params) noexcept
 

Friends

class bucket
 

Detailed Description

Factory class for managing ratelimit bucket factory objects.

Ratelimit manager class for tracking and handling ratelimit checks and dispatches Different callables and results require different instances. Global limit is not shared between instances.

Constructor & Destructor Documentation

aegis::ratelimit::ratelimit_mgr::ratelimit_mgr ( rest_call  call,
asio::io_context &  _io,
core _b 
)
explicit

Construct a ratelimit_mgr object for managing the bucket factories.

Parameters
callFunction pointer to the REST API function

Member Function Documentation

bucket& aegis::ratelimit::ratelimit_mgr::get_bucket ( const std::string &  path)
noexcept

Get a bucket object.

See also
bucket
Parameters
idSnowflake of bucket object
Returns
Reference to a bucket object
bool aegis::ratelimit::ratelimit_mgr::is_global ( ) const
noexcept

Check if globally ratelimited.

Returns
true if globally ratelimited

The documentation for this class was generated from the following file: