setup jobs

This commit is contained in:
Jaremy Creechley 2024-02-09 23:05:39 -07:00
parent 33a837cf65
commit 49a050dca1
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -23,11 +23,11 @@ type
proc processJobs*(jobs: JobQueue) {.async.} =
while jobs.running:
echo "jobs running..."
let res = jobs.queue.wait()
let res = await jobs.queue.wait()
echo "jobs result: ", res.repr
proc newJobQueue*[T](maxItems: int = 0, taskpool: Taskpool = Taskpool.new()): JobQueue[T] {.raises: [ApatheiaSignalErr].} =
result = JobQueue[T](queue: newSignalQueue[(uint, T)](maxItems), taskpool: taskpool)
result = JobQueue[T](queue: newSignalQueue[(uint, T)](maxItems), taskpool: taskpool, running: true)
asyncSpawn(processJobs(result))
macro submitMacro*(tp: untyped, jobs: untyped, exp: untyped): untyped =