mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
cluster/websocket: Make websocket dispatcher queue size configurable
Limit the number WebSocket events queued from external clients to dispatcher instances to produce back pressure to the clients if Zeek's IO loop is overloaded.
This commit is contained in:
parent
6bd624d9b2
commit
011029addc
9 changed files with 45 additions and 10 deletions
|
@ -214,9 +214,11 @@ public:
|
|||
bool OnFinish(double network_time) override { return true; }
|
||||
};
|
||||
|
||||
WebSocketEventDispatcher::WebSocketEventDispatcher() {
|
||||
WebSocketEventDispatcher::WebSocketEventDispatcher(std::string ident, size_t queue_size) {
|
||||
onloop =
|
||||
new zeek::detail::OnLoopProcess<WebSocketEventDispatcher, WebSocketEvent>(this, "WebSocketEventDispatcher");
|
||||
new zeek::detail::OnLoopProcess<WebSocketEventDispatcher, WebSocketEvent>(this,
|
||||
"WebSocketEventDispatcher:" + ident,
|
||||
queue_size);
|
||||
// Register the onloop instance the IO loop. Lifetime will be managed by the loop.
|
||||
onloop->Register(false);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue