mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 07:15:22 +00:00
lots of small changes
This commit is contained in:
@@ -9,6 +9,6 @@ import asyncdispatch
|
||||
proc testCallback() =
|
||||
echo "testCallback()"
|
||||
|
||||
when isMainModule:
|
||||
when true:
|
||||
callSoon(testCallback)
|
||||
poll()
|
||||
|
||||
@@ -27,7 +27,7 @@ proc serve() {.async.} =
|
||||
var fut = await accept()
|
||||
await processClient(fut)
|
||||
|
||||
when isMainModule:
|
||||
when true:
|
||||
proc main =
|
||||
var fut = serve()
|
||||
fut.callback =
|
||||
|
||||
@@ -15,7 +15,7 @@ proc asyncRecursionTest*(): Future[int] {.async.} =
|
||||
inc(result, await asyncRecursionCycle(i))
|
||||
inc(i)
|
||||
|
||||
when isMainModule:
|
||||
when true:
|
||||
setGlobalDispatcher(newDispatcher())
|
||||
var i = waitFor asyncRecursionTest()
|
||||
echo i
|
||||
|
||||
Reference in New Issue
Block a user