I'm writting a little asynchronous port scan with Nim (source code).
I use asyncCheck for asynchronous parallelism, like in the documentation, and asyncCheck break my function: there is nothing printed in my console (the function end is an echo)
asyncCheck does not wait for future completion, so your asyncfunction completes immediately.
If you need to wait for more than one futures execution, use all.
import asyncdispatch
proc run() {.async.} =
await sleepAsync(10)
echo "run"
proc main() {.async.} =
var futures = newSeq[Future[void]]()
for i in 0..10:
futures.add run()
await all(futures)
waitFor main()