mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-02-07 17:05:41 +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()):
|
if not(aq.empty()) and not(getter.cancelled()):
|
||||||
aq.getters.wakeupNext()
|
aq.getters.wakeupNext()
|
||||||
raise exc
|
raise exc
|
||||||
aq.peakFirstImpl()
|
let res = aq.peakFirstImpl()
|
||||||
|
aq.getters.wakeupNext()
|
||||||
|
res
|
||||||
|
|
||||||
proc peakLast*[T](aq: AsyncQueue[T]): Future[T] {.
|
proc peakLast*[T](aq: AsyncQueue[T]): Future[T] {.
|
||||||
async: (raises: [CancelledError]).} =
|
async: (raises: [CancelledError]).} =
|
||||||
@ -413,7 +415,9 @@ proc peakLast*[T](aq: AsyncQueue[T]): Future[T] {.
|
|||||||
if not(aq.empty()) and not(getter.cancelled()):
|
if not(aq.empty()) and not(getter.cancelled()):
|
||||||
aq.getters.wakeupNext()
|
aq.getters.wakeupNext()
|
||||||
raise exc
|
raise exc
|
||||||
aq.peakLastImpl()
|
let res = aq.peakLastImpl()
|
||||||
|
aq.getters.wakeupNext()
|
||||||
|
res
|
||||||
|
|
||||||
proc putNoWait*[T](aq: AsyncQueue[T], item: T) {.
|
proc putNoWait*[T](aq: AsyncQueue[T], item: T) {.
|
||||||
raises: [AsyncQueueFullError].} =
|
raises: [AsyncQueueFullError].} =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user