rename queue

This commit is contained in:
Jaremy Creechley 2024-02-09 21:52:37 -07:00
parent e4242132f7
commit 8732cc13fb
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 4 additions and 3 deletions

View File

@ -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()

View File

@ -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