From 721f2e7ef7f4667f6bea64a4c64fbb99fb0594f1 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Wed, 14 Feb 2024 21:58:47 -0700 Subject: [PATCH] logging --- src/apatheia/tasks.nim | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/apatheia/tasks.nim b/src/apatheia/tasks.nim index 0360dc9..cd36901 100644 --- a/src/apatheia/tasks.nim +++ b/src/apatheia/tasks.nim @@ -25,22 +25,19 @@ macro asyncTask*(p: untyped): untyped = body = p[6] name = repr(procId).strip(false, true, {'*'}) - echo "\nASYNC_TASK: " - echo "name: ", name - # echo "ASYNC_TASK: call: \n", tcall.treeRepr if not hasReturnType(params): error("tasklet definition must have return type", p) + # setup inner tasklet proc let tp = mkProc(procId.procIdentAppend("Tasklet"), params, body) + # setup async wrapper code var asyncBody = newStmtList() let tcall = newCall(ident(name & "Tasklet")) for paramId, paramType in paramsIter(params): echo "param: ", paramId, " tp: ", paramType.treeRepr tcall.add newCall("checkParamType", paramId) - # asyncBody.add nnkLetSection.newTree( - # nnkIdentDefs.newTree(ident"res", newEmptyNode(), tcall)) asyncBody = quote do: let val {.inject.} = `tcall` discard jobResult.queue.send((jobResult.id, val,)) @@ -57,13 +54,10 @@ macro asyncTask*(p: untyped): untyped = asyncParams.insert(1, jobArg) let fn = mkProc(procId, asyncParams, asyncBody) - # echo "asyncTask:fn:body:\n", fn.treerepr - result = newStmtList() result.add tp result.add fn - echo "asyncTask:body:\n", result.repr - # echo "asyncTask:body:\n", result.treeRepr + # echo "asyncTask:body:\n", result.repr type HashOptions* = object