Move stuff around; Add some missing overloads

This commit is contained in:
Zahary Karadjov 2020-05-05 23:57:27 +03:00
commit 65b43d9e38
No known key found for this signature in database
GPG key ID: C8936F8A3073D609
4 changed files with 50 additions and 36 deletions

View file

@ -2,6 +2,9 @@ import
stew/shims/macros,
async_backend, inputs, outputs
export
async_backend
macro fsMultiSync*(body: untyped) =
# We will produce an identical copy of the annotated proc,
# but taking async parameters and having the async pragma.
@ -13,9 +16,9 @@ macro fsMultiSync*(body: untyped) =
# The return types becomes Future[T]
if asyncProcParams[0].kind == nnkEmpty:
asyncProcParams[0] = newTree(nnkBracketExpr, ident"Future", ident"void")
asyncProcParams[0] = newTree(nnkBracketExpr, bindSym"Future", ident"void")
else:
asyncProcParams[0] = newTree(nnkBracketExpr, ident"Future", asyncProcParams[0])
asyncProcParams[0] = newTree(nnkBracketExpr, bindSym"Future", asyncProcParams[0])
# We replace all stream inputs with their async counterparts
for i in 1 ..< asyncProcParams.len: