title: Rate-limiting a Worker for a Queue (e.g.: SQS)
body: <p>Every day, I will have a CRON task run which populates an SQS queue with a number of tasks which needs to be achieved. So (for example) at 9AM every morning, and empty queue will receive ~100 messages that will need to be processed.</p>
  
  <p>I would like a new worker to be spun up every second until the queue is empty. If any task fails, it's put at the back of the queue to be re-run.</p>
  
  <p>For example, if each task takes up to 1.5 seconds to complete:</p>
  
  <ul>
  <li>after 1 second, 1 worker will have started message A</li>
  <li>after 2 seconds, 1 worker may still be running message A and 1 worker will have started running message B</li>
  <li>after 100 seconds, 1 worker may still be running message XX and 1 worker will pick up message B because it failed previous</li>
  <li>after 101 seconds, no more workers are propagated until the next morning</li>
  </ul>
  
  <p>Is there any way to have this type of infrastructure configured within AWS lambda?</p>