Loop::defer and almost working async streaming

This commit is contained in:
Alex Hultman
2018-09-23 21:48:29 +02:00
parent 2fb87b67c7
commit 8106a0f628
6 changed files with 123 additions and 17 deletions
+13
View File
@@ -1,8 +1,19 @@
#ifndef LOOPDATA_H
#define LOOPDATA_H
#include <thread>
#include <functional>
#include <vector>
#include <mutex>
namespace uWS {
struct LoopData {
friend struct Loop;
private:
std::mutex deferMutex;
int currentDeferQueue = 0;
std::vector<std::function<void()>> deferQueues[2];
public:
/* Good 16k for SSL perf. */
@@ -14,4 +25,6 @@ public:
bool corked = false;
};
}
#endif // LOOPDATA_H