MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / process

Method process

lib/HttpService/src/HttpService.cpp:125–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void HttpService::process()
126{
127 MutexGuard<Mutex> guard(m_mutex);
128
129 if (true == m_isRunning)
130 {
131 if (true == m_workerData.mutex.take(0U))
132 {
133 /* Handle received HTTP responses. */
134 if (INVALID_HTTP_JOB_ID != m_workerData.response.jobId)
135 {
136 m_responseList.emplace_back(m_workerData.response);
137
138 /* Clear worker response. */
139 m_workerData.response = WorkerResponse();
140
141 /* Clear active job id. */
142 m_activeJobId = INVALID_HTTP_JOB_ID;
143 }
144
145 /* Handle pending HTTP requests. */
146 if (INVALID_HTTP_JOB_ID == m_activeJobId)
147 {
148 /* Check for new requests to process. */
149 if (false == m_requestList.empty())
150 {
151 m_workerData.request = m_requestList.front();
152 m_activeJobId = m_workerData.request.jobId;
153
154 /* Remove the request from the list. */
155 (void)m_requestList.erase(m_requestList.begin());
156 }
157 }
158
159 (void)m_workerData.mutex.give();
160 }
161 }
162}
163
164HttpJobId HttpService::get(const char* url, IHttpResponseHandler* handler)
165{

Callers

nothing calls this directly

Calls 4

WorkerResponseClass · 0.85
takeMethod · 0.45
beginMethod · 0.45
giveMethod · 0.45

Tested by

no test coverage detected