Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up
Fetching contributors…

package jsonrpc2 | |
import "context" | |
// AsyncHandler wraps a Handler such that each request is handled in its own | |
// goroutine. It is a convenience wrapper. | |
func AsyncHandler(h Handler) Handler { | |
return asyncHandler{h} | |
} | |
type asyncHandler struct { | |
Handler | |
} | |
func (h asyncHandler) Handle(ctx context.Context, conn *Conn, req *Request) { | |
go h.Handler.Handle(ctx, conn, req) | |
} |