Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nitely committed Mar 16, 2024
1 parent 3fe3614 commit 59a9dc7
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 208 deletions.
14 changes: 6 additions & 8 deletions src/hyperx/queue.nim
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ proc close*[T](q: QueueAsync[T]) {.raises: [].} =
if q.isClosed:
return
q.isClosed = true
for ev in items q.putEv:
if not ev.finished:
untrackExceptions:
ev.fail newQueueClosedError()
for ev in items q.popEv:
if not ev.finished:
untrackExceptions:
ev.fail newQueueClosedError()
while q.putEv.len > 0:
untrackExceptions:
q.putEv.popFirst().fail newQueueClosedError()
while q.popEv.len > 0:
untrackExceptions:
q.popEv.popFirst().fail newQueueClosedError()

when isMainModule:
block:
Expand Down
Loading

0 comments on commit 59a9dc7

Please sign in to comment.