MCPcopy
hub / github.com/lxc/incus / Start

Function Start

internal/server/task/start.go:15–24  ·  view source on GitHub ↗

Start a single task executing the given function with the given schedule. This is a convenience around Group and it returns two functions that can be used to control the task. The first is a "stop" function trying to terminate the task gracefully within the given timeout and the second is a "reset"

(ctx context.Context, f Func, schedule Schedule)

Source from the content-addressed store, hash-verified

13// function to reset the task's state. See Group.Stop() and Group.Reset() for
14// more details.
15func Start(ctx context.Context, f Func, schedule Schedule) (func(time.Duration) error, func()) {
16 group := Group{}
17 task := group.Add(f, schedule)
18 group.Start(ctx)
19
20 stop := group.Stop
21 reset := task.Reset
22
23 return stop, reset
24}

Callers 2

TestTask_ResetFunction · 0.92
startTaskFunction · 0.92

Calls 2

AddMethod · 0.95
StartMethod · 0.95

Tested by 2

TestTask_ResetFunction · 0.74
startTaskFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…