From 53efcaedc9cdd155478d092b578c1ea5f8645db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 30 Jul 2024 07:44:08 +0200 Subject: [PATCH] Execute websocket handlers as goroutines. Bumped to 0.2.17 --- pkg.go | 2 +- ws_conn_manager/pkg.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg.go b/pkg.go index b7492c2..a5baa56 100644 --- a/pkg.go +++ b/pkg.go @@ -64,7 +64,7 @@ import ( "strings" ) -const VERSION = "v0.2.14" +const VERSION = "v0.2.17" type HttpHandler func(http.ResponseWriter, *http.Request) diff --git a/ws_conn_manager/pkg.go b/ws_conn_manager/pkg.go index 5a4af9e..cb8ae59 100644 --- a/ws_conn_manager/pkg.go +++ b/ws_conn_manager/pkg.go @@ -117,7 +117,7 @@ func (cm *ConnectionManager) ReadLoop(wsConn *WsConnection) { // {{{ cm.logger.Debug("websocket", "op", "read", "data", data) for _, handler := range cm.readHandlers { - handler(cm, wsConn, data) + go handler(cm, wsConn, data) } } } // }}}