mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-29 10:01:39 +00:00
Introduce callSoon() implementation. Patch tests to use waitFor() instead of asyncCheck()
20 lines
239 B
Nim
20 lines
239 B
Nim
discard """
|
|
output: "adf"
|
|
"""
|
|
|
|
import asyncdispatch
|
|
const
|
|
test = ["adf"]
|
|
|
|
proc foo() {.async.} =
|
|
for i in test:
|
|
echo(i)
|
|
|
|
var finished = false
|
|
let x = foo()
|
|
x.callback =
|
|
proc () =
|
|
finished = true
|
|
|
|
while not finished: poll()
|