Merge branch '10669-safe-http-cache'
[arvados.git] / services / ws / handler.go
index b07b78cc7c3fbbf7c69b39111f1959bb5da96921..72291900fac52c4192f4db971e29bd736be5c189 100644 (file)
@@ -53,6 +53,8 @@ func (h *handler) Handle(ws wsConn, eventSource eventSource, newSession func(wsC
                return
        }
 
+       // Receive websocket frames from the client and pass them to
+       // sess.Receive().
        go func() {
                buf := make([]byte, 2<<20)
                for {
@@ -84,6 +86,9 @@ func (h *handler) Handle(ws wsConn, eventSource eventSource, newSession func(wsC
                }
        }()
 
+       // Take items from the outgoing queue, serialize them using
+       // sess.EventMessage() as needed, and send them to the client
+       // as websocket frames.
        go func() {
                for {
                        var ok bool