mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-05 22:43:10 +00:00
rename queue
This commit is contained in:
parent
e4242132f7
commit
8732cc13fb
@ -59,5 +59,6 @@ proc tryRecv*[T](c: SignalQueue[T]): Option[T] =
|
|||||||
if res.dataAvailable:
|
if res.dataAvailable:
|
||||||
some res.msg
|
some res.msg
|
||||||
|
|
||||||
proc wait*[T](c: SignalQueue[T]) {.async.} =
|
proc wait*[T](c: SignalQueue[T]): Future[Result[T, string]] {.async.} =
|
||||||
await wait(c.signal)
|
await wait(c.signal)
|
||||||
|
return c.recv()
|
||||||
|
|||||||
@ -27,8 +27,8 @@ suite "async tests":
|
|||||||
|
|
||||||
# await sleepAsync(100.milliseconds)
|
# await sleepAsync(100.milliseconds)
|
||||||
echo "waiting on queue"
|
echo "waiting on queue"
|
||||||
await wait(queue).wait(1500.milliseconds)
|
let res = await wait(queue).wait(1500.milliseconds)
|
||||||
echo "result: ", queue.recv()
|
echo "result: ", res
|
||||||
|
|
||||||
# echo "\nRES: ", args.value
|
# echo "\nRES: ", args.value
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user