D++ (DPP)
C++ Discord API Bot Library
dpp::in_thread Class Reference

Represents a thread in the thread pool handling requests to HTTP(S) servers. There are several of these, the total defined by a constant in queues.cpp, and each one will always receive requests for the same rate limit bucket based on its endpoint portion of the url. This makes rate limit handling reliable and easy to manage. Each of these also has its own mutex, so that requests are less likely to block while waiting for internal containers to be usable. More...

#include <queues.h>

Public Member Functions

 in_thread (class cluster *owner, class request_queue *req_q, uint32_t index)
 Construct a new in thread object. More...
 
 ~in_thread ()
 Destroy the in thread object This will end the thread that is owned by this object by joining it. More...
 
void terminate ()
 Terminates the thread This will end the thread that is owned by this object, but will not join it. More...
 
void post_request (std::unique_ptr< http_request > req)
 Post a http_request to this thread. More...
 

Detailed Description

Represents a thread in the thread pool handling requests to HTTP(S) servers. There are several of these, the total defined by a constant in queues.cpp, and each one will always receive requests for the same rate limit bucket based on its endpoint portion of the url. This makes rate limit handling reliable and easy to manage. Each of these also has its own mutex, so that requests are less likely to block while waiting for internal containers to be usable.

Constructor & Destructor Documentation

◆ in_thread()

dpp::in_thread::in_thread ( class cluster owner,
class request_queue req_q,
uint32_t  index 
)

Construct a new in thread object.

Parameters
ownerOwning cluster
req_qOwning request queue
indexThread index number

◆ ~in_thread()

dpp::in_thread::~in_thread ( )

Destroy the in thread object This will end the thread that is owned by this object by joining it.

Member Function Documentation

◆ post_request()

void dpp::in_thread::post_request ( std::unique_ptr< http_request req)

Post a http_request to this thread.

Parameters
reqhttp_request to post. The pointer will be freed when it has been executed.

◆ terminate()

void dpp::in_thread::terminate ( )

Terminates the thread This will end the thread that is owned by this object, but will not join it.

D++ Library version 10.0.34D++ Library version 10.0.33D++ Library version 10.0.32D++ Library version 10.0.31D++ Library version 10.0.30D++ Library version 10.0.29D++ Library version 10.0.28D++ Library version 10.0.27D++ Library version 10.0.26D++ Library version 10.0.25D++ Library version 10.0.24D++ Library version 10.0.23D++ Library version 10.0.22D++ Library version 10.0.21D++ Library version 10.0.20D++ Library version 10.0.19D++ Library version 10.0.18D++ Library version 10.0.17D++ Library version 10.0.16D++ Library version 10.0.15D++ Library version 10.0.14D++ Library version 10.0.13D++ Library version 10.0.12D++ Library version 10.0.11D++ Library version 10.0.10D++ Library version 10.0.9D++ Library version 10.0.8D++ Library version 10.0.7D++ Library version 10.0.6D++ Library version 10.0.5D++ Library version 10.0.4D++ Library version 10.0.3D++ Library version 10.0.2D++ Library version 10.0.1D++ Library version 10.0.0D++ Library version 9.0.19D++ Library version 9.0.18D++ Library version 9.0.17D++ Library version 9.0.16D++ Library version 9.0.15D++ Library version 9.0.14D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0