MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / Async

Function Async

internal/jsonrpc2/conn.go:334–338  ·  view source on GitHub ↗

Async, signals that the current jsonrpc2 request may be handled asynchronously to subsequent requests, when ctx is the request context. Async must be called at most once on each request's context (and its descendants).

(ctx context.Context)

Source from the content-addressed store, hash-verified

332// Async must be called at most once on each request's context (and its
333// descendants).
334func Async(ctx context.Context) {
335 if r, ok := ctx.Value(asyncKey).(*releaser); ok {
336 r.release(false)
337 }
338}
339
340type asyncKeyType struct{}
341

Callers 2

handleMethod · 0.92
handleMethod · 0.92

Calls 2

ValueMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…