mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-11 11:49:33 +00:00
Resolve bugs with deep recursion of asyncdispatch.
Introduce callSoon() implementation. Patch tests to use waitFor() instead of asyncCheck()
This commit is contained in:
@@ -36,4 +36,4 @@ proc main {.async.} =
|
||||
discard await g()
|
||||
echo 6
|
||||
|
||||
asyncCheck main()
|
||||
waitFor(main())
|
||||
|
||||
@@ -48,7 +48,7 @@ proc catch() {.async.} =
|
||||
except OSError, EInvalidField:
|
||||
assert false
|
||||
|
||||
asyncCheck catch()
|
||||
waitFor catch()
|
||||
|
||||
proc test(): Future[bool] {.async.} =
|
||||
result = false
|
||||
@@ -92,13 +92,13 @@ proc test4(): Future[int] {.async.} =
|
||||
result = 2
|
||||
|
||||
var x = test()
|
||||
assert x.read
|
||||
assert x.waitFor()
|
||||
|
||||
x = test2()
|
||||
assert x.read
|
||||
assert x.waitFor()
|
||||
|
||||
var y = test3()
|
||||
assert y.read == 2
|
||||
assert y.waitFor() == 2
|
||||
|
||||
y = test4()
|
||||
assert y.read == 2
|
||||
assert y.waitFor() == 2
|
||||
|
||||
@@ -16,4 +16,4 @@ x.callback =
|
||||
proc () =
|
||||
finished = true
|
||||
|
||||
while not finished: discard
|
||||
while not finished: poll()
|
||||
|
||||
Reference in New Issue
Block a user