Skip to content

Commit

Permalink
Update README for simple process worker
Browse files Browse the repository at this point in the history
  • Loading branch information
psarma89 committed May 17, 2021
1 parent 01f43cd commit e8a564e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -100,6 +100,23 @@ messages.
$ pyqs send_email --concurrency 10
Simple Process Worker
~~~~~~~~~~~~~~~~~~~~~

To use a simpler version of PyQS that deals with some of the edge cases in the original implementation, pass the ``simple-worker`` flag.

.. code:: bash
$ pyqs send_email --simple-worker
The Simple Process Worker differs in the following way from the original implementation.

* Does not use an internal queue and removes support for the ``prefetch-multiplier`` flag. This helps simply the mental model required, as messages are not on both the SQS queue and an internal queue.
* When the ``simple-worker`` flag is passed, the default ``batchsize`` is 1 instead of 10. This is configurable.
* Does not check the visibility timeout when reading or processing a message from SQS.
* Allowing the worker to process the message even past its visibility timeout means we solve the problem of never processing a message if ``max_receives=1`` and we incorrectly set a shorter visibility timeout and exceed the visibility timeout. Previously, this message would have ended up in the DLQ, if one was configured, and never actually processed.
* It increases the probability that we process a message more than once, especially if ``batchsize > 1``, but this can be solved by the developer checking if the message has already been processed.

Hooks
~~~~~

0 comments on commit e8a564e

Please sign in to comment.