asyncdispatch: split asyncfutures into its own module

This slightly changes behaviour of callSoon - before loop is initialized, callSoon will call the function immediately.
This commit is contained in:
Michał Zieliński 2017-06-05 00:12:44 +02:00
commit e86863e8f5
4 changed files with 52 additions and 22 deletions

View file

@ -17,5 +17,6 @@ proc asyncRecursionTest*(): Future[int] {.async.} =
inc(i)
when isMainModule:
setGlobalDispatcher(newDispatcher())
var i = waitFor asyncRecursionTest()
echo i