refactoring

This commit is contained in:
Jaremy Creechley 2024-02-13 21:49:59 -07:00
parent 3727c4855b
commit fbad0e13a5
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 1 additions and 3 deletions

View File

@ -72,6 +72,6 @@ template submit*[T](jobs: JobQueue[T], exp: untyped): Future[T] =
template jobWrapper*(task: untyped) =
template `task Wrapper`*(jobResult: JobResult[float], args: varargs[untyped]) =
let res = unpackVarargs(`task`(args))
let res = unpackVarargs(`task`, args)
discard jobResult.queue.send((jobResult.id, res,))

View File

@ -20,8 +20,6 @@ proc addNums(jobResult: JobResult[float], a, b: float) =
let res = addNumsRaw(a, b)
discard jobResult.queue.send((jobResult.id, res,))
jobWrapper(addNumsRaw)
suite "async tests":
# var tp = Taskpool.new(num_threads = 2) # Default to the number of hardware threads.