mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-03 13:33:08 +00:00
setup jobs
This commit is contained in:
parent
98075da2b2
commit
33a837cf65
@ -47,7 +47,7 @@ macro submitMacro*(tp: untyped, jobs: untyped, exp: untyped): untyped =
|
||||
echo "submit: ", fncall.treeRepr
|
||||
|
||||
result = quote do:
|
||||
let `queueName` = jobs.queue
|
||||
let `queueName` = `jobs`.queue
|
||||
let `futName` = newFuture[`tp`](astToStr(`exp`))
|
||||
let `idName` = `futName`.id()
|
||||
`jobs`.futures[`idName`] = `futName`
|
||||
|
||||
@ -24,10 +24,12 @@ suite "async tests":
|
||||
|
||||
# var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads.
|
||||
# var queue = newSignalQueue[float]()
|
||||
var jobs = newJobQueue[float]()
|
||||
|
||||
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,))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user