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