I am interested in knowing what would be the best way to implement a thread based queue.
For example:
I have 10 actions which I want to execute with only 4 t
You could use a thread pool. It's a fairly common pattern for this type of problem. http://en.wikipedia.org/wiki/Thread_pool_pattern
Github seems to have a few implementations you could try out: https://github.com/search?type=Everything&language=Ruby&q=thread+pool