MCPcopy Create free account
hub / github.com/devld/go-drive / vm_newTaskCtx

Function vm_newTaskCtx

script/call_common.go:39–46  ·  view source on GitHub ↗

vm_newTaskCtx: (ctx Context, onUpdate func(int64, int64)) TaskCtx

(vm *VM, args Values)

Source from the content-addressed store, hash-verified

37
38// vm_newTaskCtx: (ctx Context, onUpdate func(int64, int64)) TaskCtx
39func vm_newTaskCtx(vm *VM, args Values) any {
40 ctx := GetContext(args.Get(0).Raw())
41 onUpdate := args.Get(1)
42 if onUpdate.IsNil() {
43 onUpdate = nil
44 }
45 return NewTaskCtx(vm, &scriptTaskCtx{ctx, onUpdate, 0, 0, sync.Mutex{}})
46}
47
48// vm_sleep: (t time.Duration)
49func vm_sleep(vm *VM, args Values) any {

Callers

nothing calls this directly

Calls 5

GetContextFunction · 0.85
NewTaskCtxFunction · 0.85
RawMethod · 0.80
IsNilMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected