fix compilation

This commit is contained in:
Jaremy Creechley 2024-02-14 20:50:53 -07:00
parent bcab7a7aed
commit 99fcf5a92b

View File

@ -15,6 +15,9 @@ proc addNums(a, b: float, queue: SignalQueue[float]) =
echo "adding: ", a, " + ", b echo "adding: ", a, " + ", b
discard queue.send(a + b) discard queue.send(a + b)
proc addNumsRun(tp: Taskpool, queue: SignalQueue[float]) =
tp.spawn addNums(1.0, 2.0, queue)
suite "async tests": suite "async tests":
var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads. var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads.
@ -23,7 +26,7 @@ suite "async tests":
asyncTest "test": asyncTest "test":
echo "\nstart" echo "\nstart"
tp.spawn addNums(1.0, 2.0, queue) addNumsRun(tp, queue)
# await sleepAsync(100.milliseconds) # await sleepAsync(100.milliseconds)
echo "waiting on queue" echo "waiting on queue"