reserve will always return the job with the lowest pri value when selecting  
from the pool of ready jobs within a tube. But when watching multiple tubes  
it seems that it picks which tube to select from by which ready job has the  
lowest id. This is illustrated in the transcript below

use abc
USING abc
put 999999 0 0 0

INSERTED 1
use def
USING def
put 99 0 0 0

INSERTED 2
watch abc
WATCHING 2
watch def
WATCHING 3
reserve
RESERVED 1 0

Job 1 is selected even though job 2 has a lower pri and is urgent. I was  
wondering if this selection was deliberate ?

What I am doing is that I have many workers, but some I want to remain idle  
to process only urgent jobs. I do this by using 2 tubes where urgent jobs  
are put in one and other jobs in another. Some workers only watch the  
urgent queue, but other workers watch both. However the other workers are  
never processing urgent jobs when all urgent workers are busy because there  
are non-urgent jobs with a lower job id.

Another approach I though might be possible, but would require some work to  
implement, was to add two commands reserve-urgent and  
reserve-urgent-timeout which would only return urgent jobs. This would  
allow all jobs to go into one queue, but still have some workers allocated  
to only process urgent jobs.

Thoughts?

Graham.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"beanstalk-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/beanstalk-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to