title: Multi-threaded RPC with timeout and resend using RabbitMQ
body: <p>What I'm looking to do is a Map/Reduce system using RabbitMQ as the transport to and from the worker agents, this is to allow a simple scaling roadmap but also allows for a single server implementation for development and testing.</p>
  
  <p>I've seen a few articles on a single message with a timeout using RPC with RabbitMQ but these appear to be blocking. I need to be able to fire off a batch of requests, each could possibly be served by a different agent. I then need to be able to collate all of the responses so I can crunch to a single answer.</p>
  
  <p>If I were to use RPC, I believe I'd end up with a very complicated serial processing of the tasks rather than in parallel.</p>
  
  <p>I'd also like to be able to resend a request under certain circumstances (e.g. the agent reports a transient error), but this isn't essential.</p>
  
  <p>I'm guessing I'm going to need to spawn the threads in the master application and each have an RPC call but as it's a web app and there could be in the region of 20 tasks to be served by the agents, I'm not keen on this approach and suspect it would be a bottleneck quickly.</p>