mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-02 13:03:11 +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)
|
||||
|
||||
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)
|
||||
echo "result: ", res.repr
|
||||
|
||||
@ -17,15 +17,11 @@ proc addNums(a, b: float): float {.asyncTask.} =
|
||||
echo "adding: ", a, " + ", b
|
||||
return a + b
|
||||
|
||||
# proc addNums(jobResult: JobResult[float], a, b: float) =
|
||||
# let res = addNumsRaw(a, b)
|
||||
# discard jobResult.queue.send((jobResult.id, res,))
|
||||
|
||||
# suite "async tests":
|
||||
# var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads.
|
||||
# asyncTest "test":
|
||||
# var jobs = newJobQueue[float](taskpool = tp)
|
||||
# echo "\nstart"
|
||||
# let res = await jobs.submit(addNums(1.0, 2.0,))
|
||||
# echo "result: ", res.repr
|
||||
# check true
|
||||
suite "async tests":
|
||||
var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads.
|
||||
asyncTest "test":
|
||||
var jobs = newJobQueue[float](taskpool = tp)
|
||||
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