mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-10-31 22:38:49 +00:00
75513575be
* store dependency's in git * since we vendor ... rm tech-depts * aad make target 'vendor' to update vendor folder (manual task)
17 lines
378 B
Go
17 lines
378 B
Go
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)
|
|
}
|