MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / run

Method run

Sources/Dependencies/ixwebsocket/IXHttpClient.cpp:91–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 void HttpClient::run()
92 {
93 while (true)
94 {
95 HttpRequestArgsPtr args;
96 OnResponseCallback onResponseCallback;
97
98 {
99 std::unique_lock<std::mutex> lock(_queueMutex);
100
101 while (!_stop && _queue.empty())
102 {
103 _condition.wait(lock);
104 }
105
106 if (_stop) return;
107
108 auto p = _queue.front();
109 _queue.pop();
110
111 args = p.first;
112 onResponseCallback = p.second;
113 }
114
115 if (_stop) return;
116
117 HttpResponsePtr response = request(args->url, args->verb, args->body, args);
118 onResponseCallback(response);
119
120 if (_stop) return;
121 }
122 }
123
124 HttpResponsePtr HttpClient::request(const std::string& url,
125 const std::string& verb,

Callers

nothing calls this directly

Calls 4

waitMethod · 0.80
popMethod · 0.80
emptyMethod · 0.45
frontMethod · 0.45

Tested by

no test coverage detected