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:
parent
2cc94179e1
commit
ddb146fd0d
3 changed files with 83 additions and 24 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue