I'm trying to use Backburner (a Ruby client for Beanstalkd) in my application to create, say, 50 workers all watching the same tube for incoming jobs. The problem is, each of those 50 workers, when performing a job, does some heavy file manipulation, etc., and each of them needs to perform some operations on a uniquely-named numbered directory. For example, worker 7 needs to work with a directory named dir7.
Initially I thought I could make a ThreadsOnFork
worker with 50 threads, and I'd be able to access a number associated with each thread from the worker's perform() method, but I haven't been able to do this yet.
How do I handle this situation using Backburner? Or, if it's not possible with Backburner, using some other Ruby beanstalkd client? I hope I'm getting my question across clearly enough. Thanks.