VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::HttpClient::Requests Struct Reference

Public Member Functions

void Work ()
 
void Complete (HttpCompletion onComplete, HttpResult result)
 
std::optional< WaitingRequest > Take ()
 

Public Attributes

std::mutex Mutex
 
std::condition_variable Wake
 
std::deque< WaitingRequest > Waiting
 
std::vector< std::thread > Workers
 
size_t IdleWorkers = 0
 
GameThreadQueue Completions
 
std::atomic_bool Stopped = false
 

Detailed Description

Shared with the workers; Mutex guards the queue and the worker list.

Definition at line 63 of file HttpClient.cpp.

Member Function Documentation

◆ Complete()

void VoltMod::HttpClient::Requests::Complete ( HttpCompletion  onComplete,
HttpResult  result 
)
inline

Runs onComplete with result on the game thread's next frame.

Definition at line 82 of file HttpClient.cpp.

References Completions, VoltMod::GameThreadQueue::Push(), and VoltMod::ReadFile().

Referenced by Work().

◆ Take()

std::optional< WaitingRequest > VoltMod::HttpClient::Requests::Take ( )
inline

Waits for the next request; nothing once stopped.

Definition at line 93 of file HttpClient.cpp.

References IdleWorkers, Mutex, VoltMod::ReadFile(), Stopped, Waiting, and Wake.

Referenced by Work().

◆ Work()

void VoltMod::HttpClient::Requests::Work ( )
inline

Definition at line 73 of file HttpClient.cpp.

References Complete(), VoltMod::Perform(), VoltMod::ReadFile(), Stopped, and Take().

Member Data Documentation

◆ Completions

GameThreadQueue VoltMod::HttpClient::Requests::Completions

Definition at line 70 of file HttpClient.cpp.

Referenced by Complete().

◆ IdleWorkers

size_t VoltMod::HttpClient::Requests::IdleWorkers = 0

Definition at line 69 of file HttpClient.cpp.

Referenced by Take().

◆ Mutex

std::mutex VoltMod::HttpClient::Requests::Mutex

Definition at line 65 of file HttpClient.cpp.

Referenced by Take().

◆ Stopped

std::atomic_bool VoltMod::HttpClient::Requests::Stopped = false

Definition at line 71 of file HttpClient.cpp.

Referenced by Take(), and Work().

◆ Waiting

std::deque<WaitingRequest> VoltMod::HttpClient::Requests::Waiting

Definition at line 67 of file HttpClient.cpp.

Referenced by Take().

◆ Wake

std::condition_variable VoltMod::HttpClient::Requests::Wake

Definition at line 66 of file HttpClient.cpp.

Referenced by Take().

◆ Workers

std::vector<std::thread> VoltMod::HttpClient::Requests::Workers

Definition at line 68 of file HttpClient.cpp.


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