mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 05:20:31 +00:00
Add hasPendingOperations check to asyncdispatch.drain
This commit is contained in:
committed by
Andreas Rumpf
parent
29db57a804
commit
3073f08e48
@@ -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``
|
||||
|
||||
Reference in New Issue
Block a user