Skip to content

Instantly share code, notes, and snippets.

@inv2004
Last active April 3, 2020 12:38
Show Gist options
  • Save inv2004/0a71607514cb278bcd64543c225e1166 to your computer and use it in GitHub Desktop.
Save inv2004/0a71607514cb278bcd64543c225e1166 to your computer and use it in GitHub Desktop.
import asyncdispatch, json
proc f(): Future[seq[JsonNode]] {.async.} =
let fullJson = %*{"list": [{"c":1}, {"c":2}]}
for json in fullJson["list"]:
result.add(json)
when isMainModule:
let cs = waitFor f()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment