Skip to content

Commit 61288e4

Browse files
committed
mcp: resolve comments
- remove unnecessary lock for sending channel - add todo to refactor the bind method
1 parent 0e17f2f commit 61288e4

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

mcp/streamable_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,7 @@ func TestServerTransportCleanup(t *testing.T) {
356356
})
357357

358358
handler.onTransportDeletion = func(sessionID string) {
359-
mu.Lock()
360359
chans[sessionID] <- struct{}{}
361-
mu.Unlock()
362360
}
363361

364362
httpServer := httptest.NewServer(handler)

mcp/transport.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func NewInMemoryTransports() (*InMemoryTransport, *InMemoryTransport) {
122122
}
123123

124124
type binder[T handler, State any] interface {
125+
// TODO(rfindley): the bind API has gotten too complicated. Simplify.
125126
bind(Connection, *jsonrpc2.Connection, State, func()) T
126127
disconnect(T)
127128
}

0 commit comments

Comments
 (0)