I am creating a multi-user postgres environment. So client A has schema_1, B has schema_2 ect ..
Now I don’t know all the clients that I have, so I have a simple little task to create a new scheme based on the data in the Tenant's table. Everything is perfectly dynamic: to add a new client, add a new tenant and rake the tenant: db: migrate .. tada all the tables are there, and the client has his own small world. (An unknown cust list, but small, so rake during registration is not a problem)
All is good ...
Except for background jobs.
I want to have a different queue for each client.
http://blog.kabisa.nl/2010/03/16/dynamic-queue-assignment-for-resque-jobs/ still uses hard-coded queues. He can choose between the two that you knew about when you wrote the code, but they are still not very dynamic. Not really.
So my question. I have the line "tenant_1" describing the world of my clients.
How can I use this line to create a queue that contains jobs only for "him".
How to create real dynamic queues?
source
share