MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / WithCancelCtx

Function WithCancelCtx

pkg/task/task.go:118–124  ·  view source on GitHub ↗
(task *Task[K])

Source from the content-addressed store, hash-verified

116}
117
118func WithCancelCtx[K comparable](task *Task[K]) *Task[K] {
119 ctx, cancel := context.WithCancel(context.Background())
120 task.Ctx = ctx
121 task.cancel = cancel
122 task.state = PENDING
123 return task
124}

Callers 3

TestTask_ManagerFunction · 0.85
TestTask_CancelFunction · 0.85
TestTask_RetryFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestTask_ManagerFunction · 0.68
TestTask_CancelFunction · 0.68
TestTask_RetryFunction · 0.68