mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-05 14:33:10 +00:00
setting up wrappers
This commit is contained in:
parent
e390d915fa
commit
3fd3bb2f3d
@ -32,7 +32,7 @@ suite "async tests":
|
|||||||
var jobs = newJobQueue[float](taskpool = tp)
|
var jobs = newJobQueue[float](taskpool = tp)
|
||||||
|
|
||||||
echo "\nstart"
|
echo "\nstart"
|
||||||
let res = await jobs.submit(addNums2(1.0, 2.0,))
|
let res = await jobs.submit(addNums(1.0, 2.0,))
|
||||||
|
|
||||||
# await sleepAsync(100.milliseconds)
|
# await sleepAsync(100.milliseconds)
|
||||||
echo "result: ", res.repr
|
echo "result: ", res.repr
|
||||||
|
|||||||
@ -17,15 +17,11 @@ proc addNums(a, b: float): float {.asyncTask.} =
|
|||||||
echo "adding: ", a, " + ", b
|
echo "adding: ", a, " + ", b
|
||||||
return a + b
|
return a + b
|
||||||
|
|
||||||
# proc addNums(jobResult: JobResult[float], a, b: float) =
|
suite "async tests":
|
||||||
# let res = addNumsRaw(a, b)
|
var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads.
|
||||||
# discard jobResult.queue.send((jobResult.id, res,))
|
asyncTest "test":
|
||||||
|
var jobs = newJobQueue[float](taskpool = tp)
|
||||||
# suite "async tests":
|
echo "\nstart"
|
||||||
# var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads.
|
let res = await jobs.submit(addNums(1.0, 2.0,))
|
||||||
# asyncTest "test":
|
echo "result: ", res.repr
|
||||||
# var jobs = newJobQueue[float](taskpool = tp)
|
check true
|
||||||
# echo "\nstart"
|
|
||||||
# let res = await jobs.submit(addNums(1.0, 2.0,))
|
|
||||||
# echo "result: ", res.repr
|
|
||||||
# check true
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user