title: Good way to notify distributor that the worker can't process any more messages
body: <p>I currently have a distributor service and a worker service that communicate via SQS. The distributor searches for expired values in a postgresql database and sends them to SQS.</p>
  <p>The worker picks up jobs from SQS and calls an API to get more data. This API has a quota limit.</p>
  <p>When the worker reaches this quota what is the best way to notify the distributor that no more work should be sent?</p>
  <p>My initial ideas:</p>
  <ul>
  <li>Go back into postgres and reinsert the data with a much later expiration date such that the next time it is processed I will surely have enough quota units. (I have to do this anyway as there are 3 requests to get all the data and failing 1/3 means I would have to reinsert the job).</li>
  <li>Send a stop signal through the queue that the distributor will receive. The only issue to get around here is that I would not want the message to stay in the queue longer than needed, and having more than one distributor running at the same time complicates message consumption.</li>
  <li>Check the size of the queue before inserting something into it. This won't work well because SQS cannot give a good estimate until about 1 minute after the producers stop sending to the queue.</li>
  <li>Some sort of distributed lock in the database</li>
  </ul>