Store, manage and dispatch individual requests.
More...
|
| Ratelimiting |
| Enforce ratelimiting per the official Discord Documentation.
|
|
Store, manage and dispatch individual requests.
◆ DISCORD_ATTRIBUTES_FIELDS
#define DISCORD_ATTRIBUTES_FIELDS |
Value: \
char *reason
Definition: channel.h:393
Generic request dispatcher.
Definition: discord-internal.h:379
Attributes of response datatype.
Definition: discord-internal.h:404
Macro containing discord_attributes fields.
- Note
- this exists for discord_request alignment purposes
◆ discord_requestor_init()
Initialize the request handler.
This shall initialize a CURLM
multi handle for performing requests asynchronously, and a queue for storing individual requests
- Parameters
-
rqtor | the requestor handle to be initialized |
conf | pointer to discord_rest logging module |
token | the bot token |
◆ discord_requestor_cleanup()
Free the request handler.
- Parameters
-
◆ discord_requestor_start_pending()
Check for and start pending bucket's requests.
- Parameters
-
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
◆ discord_requestor_info_read()
Poll for request's completion.
- Parameters
-
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
◆ discord_requestor_dispatch_responses()
Run pending callbacks from completed requests.
- Parameters
-
req | the request containing preliminary information for its dispatch |
◆ discord_request_cancel()
Mark request as canceled and move it to the recycling queue.
- Parameters
-
◆ discord_request_begin()
Begin a new request.
The returned request automatically be performed from the REST
thread
- Parameters
-
rqtor | the requestor handle initialized with discord_requestor_init() |
req | the request containing preliminary information for its dispatch and response's parsing |
body | the request's body |
method | the request's HTTP method |
endpoint | the request's endpoint |
key | the request bucket's group for ratelimiting |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary