async: use -d:nimDumpAsync to see what the async macro generates
This commit is contained in:
parent
d9e44873ab
commit
d83eb70643
1 changed files with 3 additions and 1 deletions
|
|
@ -1898,7 +1898,7 @@ proc asyncSingleProc(prc: NimNode): NimNode {.compileTime.} =
|
||||||
|
|
||||||
# -> createCb(retFuture)
|
# -> createCb(retFuture)
|
||||||
#var cbName = newIdentNode("cb")
|
#var cbName = newIdentNode("cb")
|
||||||
var procCb = newCall(bindSym"createCb", retFutureSym, iteratorNameSym,
|
var procCb = getAst createCb(retFutureSym, iteratorNameSym,
|
||||||
newStrLitNode(prc[0].getName))
|
newStrLitNode(prc[0].getName))
|
||||||
outerProcBody.add procCb
|
outerProcBody.add procCb
|
||||||
|
|
||||||
|
|
@ -1933,6 +1933,8 @@ macro async*(prc: stmt): stmt {.immediate.} =
|
||||||
result.add asyncSingleProc(oneProc)
|
result.add asyncSingleProc(oneProc)
|
||||||
else:
|
else:
|
||||||
result = asyncSingleProc(prc)
|
result = asyncSingleProc(prc)
|
||||||
|
when defined(nimDumpAsync):
|
||||||
|
echo repr result
|
||||||
|
|
||||||
proc recvLine*(socket: AsyncFD): Future[string] {.async.} =
|
proc recvLine*(socket: AsyncFD): Future[string] {.async.} =
|
||||||
## Reads a line of data from ``socket``. Returned future will complete once
|
## Reads a line of data from ``socket``. Returned future will complete once
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue