Merge pull request #5163 from vegansk/5155-async

Adds pending operations presence check function to asyncdispatch, fixes #5155
This commit is contained in:
Dominik Picheta 2016-12-30 11:06:38 +00:00 • committed by GitHub
commit 09b6d8c0ca
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())