Add pending operations presence check function, fixes #5155

This commit is contained in:
Anatoly Galiulin 2016-12-29 11:22:50 +07:00
commit 8e71949b78
3 changed files with 46 additions and 2 deletions

View file

@ -0,0 +1,21 @@
discard """
file: "tpendingcheck.nim"
exitcode: 0
output: ""
"""
import asyncdispatch
doAssert(not hasPendingOperations())
proc test() {.async.} =
await sleepAsync(100)
var f = test()
while not f.finished:
doAssert(hasPendingOperations())
poll(10)
f.read
doAssert(not hasPendingOperations())