Resque .. how can I get a list of queues

Well .. On the hero I have 24 workers (as I understand it) I speak 1000 clients. Each with its own "schema" in the postgresql database.

Each client has tasks that can be completed "later." Sending orders to my companies is completed, this is a great example.

I thought that I could create a new queue for each client, and each queue would have its own worker (process). It seems that it is not in the cards.

So, I think, now I have to have a queue field in the client record. therefore, client 1 through 15 is in queue_a and client 16 through 106 are in queue_b .. ect If one client uses heaps, we can move them to a new queue or move others from the slow queue. customers with low shuttlecocks can be collected .. This would be a balancing act, but it would not be so difficult to handle if we tracked the indicators (which we will in any case)

(any counter ideas would be awesome to hear, I'm really in the ball phase)

Right now. I would like to figure out how to create a worker for each line. https://gist.github.com/486161 tells me how to create X workgroups, but it really doesn’t allow me to put a worker on the queue. If I knew this and how to get a list of queues, I think that I will be on the way to a viable solution to the restrictions.


Reading at http://blog.winfieldpeterson.com/2012/02/17/resque-queue-priority/
I understand that my plan is fraught with hardship. The first client / queue to add to the worker will receive priority. I do not want this, I would like all of them to be the same. While they are part of a single queue.
+4
source share
1 answer

I just stick to the topic :)

Getting all the queues in resque is pretty easy

Resque.queues 

- a list of all queue names, it does not include an error queue, I did something like this

 (['failed'] + Resque.queues).each do |queue| queue_size = queue=='failed' ? Resque::Failure.count : Resque.size(queue) end 
+10
source

Source: https://habr.com/ru/post/1400932/


All Articles