1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-18 13:10:02 +02:00

Cancel Handler context when connection closes

This commit is contained in:
Sam Herrmann 2025-08-13 10:54:12 -04:00
parent 2cc94179e1
commit 9ca8fdc650
3 changed files with 55 additions and 21 deletions

View file

@ -59,10 +59,10 @@ const (
// Handler handles JSON-RPC requests and notifications.
type Handler interface {
// Handle is called to handle a request. No other requests are handled
// until it returns. If you do not require strict ordering behavior
// of received RPCs, it is suggested to wrap your handler in
// AsyncHandler.
// Handle is called to handle a request. No other requests are handled until
// it returns. If you do not require strict ordering behavior of received
// RPCs, it is suggested to wrap your handler in AsyncHandler. The context
// is automatically canceled when the connection closes.
Handle(context.Context, *Conn, *Request)
}