Files
@ 9813552ebfe1
Branch filter:
Location: libtransport.git/src/HTTPRequestQueue.cpp - annotation
9813552ebfe1
709 B
text/x-c++hdr
Send api version to backend so it can use future features based on this version number
5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 | #include "transport/HTTPRequestQueue.h"
#include "transport/HTTPRequest.h"
namespace Transport {
DEFINE_LOGGER(logger, "HTTPRequestQueue")
HTTPRequestQueue::HTTPRequestQueue(int delay) {
m_delay = delay;
m_processing = false;
}
HTTPRequestQueue::~HTTPRequestQueue() {
}
void HTTPRequestQueue::sendNextRequest() {
if (m_queue.empty()) {
m_processing = false;
return;
}
if (m_processing) {
return;
}
HTTPRequest *req = m_queue.front();
m_queue.pop();
req->onRequestFinished.connect(boost::bind(&HTTPRequestQueue::sendNextRequest, this));
req->execute();
}
void HTTPRequestQueue::queueRequest(HTTPRequest *req) {
m_queue.push(req);
if (!m_processing) {
sendNextRequest();
}
}
}
|