MCPcopy Create free account
hub / github.com/krau/SaveAny-Bot / NewTask

Function NewTask

pkg/queue/task.go:27–37  ·  view source on GitHub ↗
(ctx context.Context, id string, title string, data T)

Source from the content-addressed store, hash-verified

25}
26
27func NewTask[T any](ctx context.Context, id string, title string, data T) *Task[T] {
28 cancelCtx, cancel := context.WithCancel(ctx)
29 return &Task[T]{
30 ID: id,
31 Title: title,
32 Data: data,
33 ctx: cancelCtx,
34 cancel: cancel,
35 created: time.Now(),
36 }
37}
38
39func (t *Task[T]) Cancelled() bool {
40 select {

Callers 2

AddTaskFunction · 0.92
newTaskFunction · 0.92

Calls

no outgoing calls

Tested by 1

newTaskFunction · 0.74