Skip to content

Commit 03de100

Browse files
committed
document maps in wstransport
1 parent 7e7d60c commit 03de100

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • v2/pkg/engine/datasource/graphql_datasource/subscriptionclient/transport

v2/pkg/engine/datasource/graphql_datasource/subscriptionclient/transport/ws_transport.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ type WSTransport struct {
8080
ctx context.Context
8181
opts WSTransportOptions
8282

83+
// mu guards both dialing and conns.
84+
//
85+
// dialing coalesces concurrent dial attempts: waiters block on
86+
// dialResult.done rather than each dialing independently.
87+
//
88+
// conns holds only fully established connections (dial + protocol init
89+
// complete) so every entry is always fully usable, never in a partial
90+
// ready state.
8391
mu sync.Mutex
8492
dialing map[uint64]*dialResult
8593
conns map[uint64]*wsConnection

0 commit comments

Comments
 (0)