You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! sorry if I'm misunderstanding this completely but I'm trying to create a way to queue jobs in my Raspberry Pi and only have them running sequentially. My test code is like this:
# test.py
from queick import JobQueue
from jobfunc import function
from time import time
q = JobQueue()
for i in range(1,50):
q.enqueue(function, args=(f"hello{i}",), priority=i, max_workers=1)
I was expecting this code would show me one hello{i} every 5 seconds as I'm only passing max_workers as 1 and all jobs have a different priority. Instead, after 5 seconds all jobs finish at the same time.
Any idea of what am I doing wrong? Thanks!
The text was updated successfully, but these errors were encountered:
I think I found the issue in the code. The QueueManager is creating a new executor for every job received so each job has its own executor with as many cores as the Raspberry Pi has. The ThreadPoolExecutor should only be created once before starting the watch loop
Hi! sorry if I'm misunderstanding this completely but I'm trying to create a way to queue jobs in my Raspberry Pi and only have them running sequentially. My test code is like this:
I was expecting this code would show me one
hello{i}
every 5 seconds as I'm only passing max_workers as 1 and all jobs have a different priority. Instead, after 5 seconds all jobs finish at the same time.Any idea of what am I doing wrong? Thanks!
The text was updated successfully, but these errors were encountered: