From 3073f08e4857b14a6bd1b0022fe45f461bf88171 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Sat, 30 Dec 2017 15:41:41 +0700 Subject: Add hasPendingOperations check to asyncdispatch.drain --- lib/pure/asyncdispatch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/pure') diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim index b62cf2e9b..42ffa236c 100644 --- a/lib/pure/asyncdispatch.nim +++ b/lib/pure/asyncdispatch.nim @@ -1487,7 +1487,7 @@ proc drain*(timeout = 500) = ## if there are no pending operations. In contrast to ``poll`` this ## processes as many events as are available. if runOnce(timeout): - while runOnce(0): discard + while hasPendingOperations() and runOnce(0): discard proc poll*(timeout = 500) = ## Waits for completion events and processes them. Raises ``ValueError`` -- cgit 1.4.1-2-gfad0