MCPcopy Index your code
hub / github.com/flant/shell-operator / WithContext

Function WithContext

pkg/task/queue/task_queue.go:143–147  ·  view source on GitHub ↗

WithContext sets the context for the TaskQueue

(ctx context.Context)

Source from the content-addressed store, hash-verified

141
142// WithContext sets the context for the TaskQueue
143func WithContext(ctx context.Context) TaskQueueOption {
144 return func(q *TaskQueue) {
145 q.ctx, q.cancel = context.WithCancel(ctx)
146 }
147}
148
149// WithHandler sets the task handler for the TaskQueue
150func WithHandler(fn func(ctx context.Context, t task.Task) TaskResult) TaskQueueOption {

Callers 3

TestConcurrentOperationsFunction · 0.85
NewNamedQueueMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestConcurrentOperationsFunction · 0.68