mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-01-31 21:44:57 +00:00
Wake up next getter after peak.
This commit is contained in:
parent
925e6ca9b4
commit
76f7191a0a
@ -397,7 +397,9 @@ proc peakFirst*[T](aq: AsyncQueue[T]): Future[T] {.
|
||||
if not(aq.empty()) and not(getter.cancelled()):
|
||||
aq.getters.wakeupNext()
|
||||
raise exc
|
||||
aq.peakFirstImpl()
|
||||
let res = aq.peakFirstImpl()
|
||||
aq.getters.wakeupNext()
|
||||
res
|
||||
|
||||
proc peakLast*[T](aq: AsyncQueue[T]): Future[T] {.
|
||||
async: (raises: [CancelledError]).} =
|
||||
@ -413,7 +415,9 @@ proc peakLast*[T](aq: AsyncQueue[T]): Future[T] {.
|
||||
if not(aq.empty()) and not(getter.cancelled()):
|
||||
aq.getters.wakeupNext()
|
||||
raise exc
|
||||
aq.peakLastImpl()
|
||||
let res = aq.peakLastImpl()
|
||||
aq.getters.wakeupNext()
|
||||
res
|
||||
|
||||
proc putNoWait*[T](aq: AsyncQueue[T], item: T) {.
|
||||
raises: [AsyncQueueFullError].} =
|
||||
|
Loading…
x
Reference in New Issue
Block a user