parent
4bc0b592e8
commit
7929634fad
|
@ -445,11 +445,9 @@ macro spawn*(tp: Taskpool, fnCall: typed): untyped =
|
||||||
|
|
||||||
# Package in a task
|
# Package in a task
|
||||||
let taskNode = ident("taskNode")
|
let taskNode = ident("taskNode")
|
||||||
let task = ident("task")
|
|
||||||
if not needFuture:
|
if not needFuture:
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
let `task` = toTask(`fnCall`)
|
let `taskNode` = TaskNode.new(workerContext.currentTask, toTask(`fnCall`))
|
||||||
let `taskNode` = TaskNode.new(workerContext.currentTask, `task`)
|
|
||||||
schedule(workerContext, `taskNode`)
|
schedule(workerContext, `taskNode`)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -512,8 +510,7 @@ macro spawn*(tp: Taskpool, fnCall: typed): untyped =
|
||||||
asyncCall.add fut
|
asyncCall.add fut
|
||||||
|
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
let `task` = toTask(`asyncCall`)
|
let `taskNode` = TaskNode.new(workerContext.currentTask, toTask(`asyncCall`))
|
||||||
let `taskNode` = TaskNode.new(workerContext.currentTask, `task`)
|
|
||||||
schedule(workerContext, `taskNode`)
|
schedule(workerContext, `taskNode`)
|
||||||
|
|
||||||
# Return the future / flowvar
|
# Return the future / flowvar
|
||||||
|
|
Loading…
Reference in New Issue