mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-02 13:03:11 +00:00
rename
This commit is contained in:
parent
37fbfe9867
commit
1a54fc42c1
@ -10,6 +10,6 @@ srcDir = "src"
|
||||
|
||||
requires "chronos >= 4.0.0"
|
||||
requires "threading"
|
||||
requires "taskpools"
|
||||
requires "taskpools >= 0.0.5"
|
||||
requires "chronicles"
|
||||
|
||||
|
||||
@ -75,7 +75,8 @@ macro submitMacro(tp: untyped, jobs: untyped, exp: untyped): untyped =
|
||||
|
||||
result = quote do:
|
||||
let (`jobRes`, `futName`) = createFuture(`jobs`, `nm`)
|
||||
`jobs`.taskpool.spawn(`fncall`)
|
||||
expandMacros:
|
||||
`jobs`.taskpool.spawn(`fncall`)
|
||||
`futName`
|
||||
|
||||
echo "submit: res:\n", result.repr
|
||||
|
||||
@ -12,6 +12,8 @@ import apatheia/jobs
|
||||
## todo: setup basic async + threadsignal + taskpools example here
|
||||
##
|
||||
|
||||
import std/macros
|
||||
|
||||
proc addNumsRaw(a, b: float): float =
|
||||
os.sleep(500)
|
||||
echo "adding: ", a, " + ", b
|
||||
@ -29,7 +31,6 @@ 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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user