title: Batching and queueing in a real-time webserver
body: <p><a href="https://i.stack.imgur.com/oiQDu.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/oiQDu.jpg" alt="Added a server design"></a>I need a webserver which routes the incoming requests to back-end workers by batching them every 0.5 second or when it has 50 http requests whichever happens earlier. What will be a good way to implement it in python/tornado or any other language? </p>
  
  <p>What I am thinking is to publish the incoming requests to a rabbitMQ queue and then somehow batch them together before sending to the back-end servers. What I can't figure out is how to pick multiple requests from the rabbitMq queue. Could someone point me to right direction or suggest some alternate apporach? </p>