Add close handling, move clock example to split threads
This commit is contained in:
6
stream.h
6
stream.h
@@ -10,11 +10,15 @@ class Stream {
|
||||
public:
|
||||
Stream(firecgi::Request* request);
|
||||
|
||||
[[nodiscard]] bool WriteEvent(const std::string& data, uint64_t id=0, const std::string& type="");
|
||||
void OnClose(const std::function<void()>& callback);
|
||||
|
||||
bool WriteEvent(const std::string& data, uint64_t id=0, const std::string& type="");
|
||||
bool End();
|
||||
|
||||
private:
|
||||
firecgi::Request* request_;
|
||||
|
||||
std::function<void()> on_close_;
|
||||
};
|
||||
|
||||
} // namespace firesse
|
||||
|
||||
Reference in New Issue
Block a user