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

Cancel Handler context when connection closes (#90)

This commit is contained in:
Sam Herrmann 2025-08-19 10:19:52 -04:00 committed by GitHub
parent 2cc94179e1
commit ddb146fd0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 83 additions and 24 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)
}