mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-01-02 13:03:11 +00:00
setup jobs
This commit is contained in:
parent
33a837cf65
commit
49a050dca1
@ -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 =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user