MCPcopy Index your code
hub / github.com/riverqueue/river / withClient

Function withClient

client_context.go:12–14  ·  view source on GitHub ↗
(ctx context.Context, client *Client[TTx])

Source from the content-addressed store, hash-verified

10var errClientNotInContext = errors.New("river: client not found in context, can only be used in a Worker")
11
12func withClient[TTx any](ctx context.Context, client *Client[TTx]) context.Context {
13 return context.WithValue(ctx, rivercommon.ContextKeyClient{}, client)
14}
15
16// ClientFromContext returns the Client from the context. This function can
17// only be used within a Worker's Work() method because that is the only place

Callers 2

TestClientFromContextFunction · 0.85
StartMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestClientFromContextFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…