Skip to content

Commit 52210b9

Browse files
add more explanation on how multiplexed stream is closed
1 parent af09389 commit 52210b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

engine/access/rest/websockets/controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ type Controller struct {
107107
// - Reads messages from this channel and forwards them to the client WebSocket connection.
108108
//
109109
// 4. **Channel Closing**:
110+
// The intention to close the channel comes from the reader-from-this-channel routines (controller's routines),
111+
// not the writer-to-this-channel routines (data providers).
112+
// Therefore, we have to signal the data providers to stop writing, wait for them to finish write operations,
113+
// and only after that we can close the channel.
114+
//
110115
// - The `Controller` is responsible for starting and managing the lifecycle of the channel.
111116
// - If an unrecoverable error occurs in any of the three routines (reader, writer, or keepalive),
112117
// the parent context is canceled. This triggers data providers to stop their work.

0 commit comments

Comments
 (0)