mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-02 21:13:08 +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:
|
||||
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)
|
||||
return c.recv()
|
||||
|
||||
@ -27,8 +27,8 @@ suite "async tests":
|
||||
|
||||
# await sleepAsync(100.milliseconds)
|
||||
echo "waiting on queue"
|
||||
await wait(queue).wait(1500.milliseconds)
|
||||
echo "result: ", queue.recv()
|
||||
let res = await wait(queue).wait(1500.milliseconds)
|
||||
echo "result: ", res
|
||||
|
||||
# echo "\nRES: ", args.value
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user