mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-07 15:33:09 +00:00
logging
This commit is contained in:
parent
797c9824ea
commit
2151cc3df7
@ -15,9 +15,6 @@ 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.
|
||||||
@ -25,15 +22,11 @@ suite "async tests":
|
|||||||
|
|
||||||
asyncTest "test":
|
asyncTest "test":
|
||||||
|
|
||||||
echo "\nstart"
|
## init
|
||||||
addNumsRun(tp, queue)
|
tp.spawn addNums(1.0, 2.0, queue)
|
||||||
|
|
||||||
# await sleepAsync(100.milliseconds)
|
|
||||||
echo "waiting on queue"
|
|
||||||
let res = await wait(queue).wait(1500.milliseconds)
|
let res = await wait(queue).wait(1500.milliseconds)
|
||||||
echo "result: ", res
|
|
||||||
|
|
||||||
# echo "\nRES: ", args.value
|
check res.get() == 3.0
|
||||||
|
|
||||||
check true
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user