Track streams

This commit is contained in:
flamingcow
2019-05-11 22:27:33 -07:00
parent 1f84aa25b6
commit 79709c5b25
5 changed files with 50 additions and 9 deletions

View File

@@ -15,10 +15,21 @@ class Stream {
bool WriteEvent(const std::string& data, uint64_t id=0, const std::string& type="");
bool End();
std::chrono::steady_clock::time_point LastMessageTime();
void Close();
private:
firecgi::Request* request_;
std::function<void()> on_close_;
std::mutex mu_;
std::chrono::steady_clock::time_point last_message_time_;
};
class IsFresherStream {
public:
bool operator() (Stream* a, Stream* b) const;
};
} // namespace firesse