zulip/zerver
Alex Vandiver d5a6b0f99a queue: Rename queue_size, and update for all local queues.
Despite its name, the `queue_size` method does not return the number
of items in the queue; it returns the number of items that the local
consumer has delivered but unprocessed.  These are often, but not
always, the same.

RabbitMQ's queues maintain the queue of unacknowledged messages; when
a consumer connects, it sends to the consumer some number of messages
to handle, known as the "prefetch."  This is a performance
optimization, to ensure the consumer code does not need to wait for a
network round-trip before having new data to consume.

The default prefetch is 0, which means that RabbitMQ immediately dumps
all outstanding messages to the consumer, which slowly processes and
acknowledges them.  If a second consumer were to connect to the same
queue, they would receive no messages to process, as the first
consumer has already been allocated them.  If the first consumer
disconnects or crashes, all prior events sent to it are then made
available for other consumers on the queue.

The consumer does not know the total size of the queue -- merely how
many messages it has been handed.

No change is made to the prefetch here; however, future changes may
wish to limit the prefetch, either for memory-saving, or to allow
multiple consumers to work the same queue.

Rename the method to make clear that it only contains information
about the local queue in the consumer, not the full RabbitMQ queue.
Also include the waiting message count, which is used by the
`consume()` iterator for similar purpose to the pending events list.
2020-10-09 20:40:39 -07:00
..
data_import import_util: Migrate from run_parallel to multiprocessing. 2020-09-14 16:22:23 -07:00
lib queue: Rename queue_size, and update for all local queues. 2020-10-09 20:40:39 -07:00
management deliver_scheduled_messages: Exit cleanly on Ctrl+C. 2020-10-07 16:15:19 -07:00
migrations realm: Add wildcard_mention_policy setting. 2020-10-01 12:18:03 -07:00
openapi eslint: Fix unicorn/{new-for-builtins,throw-new-error,error-message}. 2020-10-07 16:00:33 -07:00
templatetags python: Replace list literal concatenation with * unpacking. 2020-09-02 11:15:41 -07:00
tests queue: Rename queue_size, and update for all local queues. 2020-10-09 20:40:39 -07:00
tornado event_schema: Add documentation and rename a few functions. 2020-09-25 12:53:00 -07:00
views streams: Change access_stream_for_delete_or_update to also return sub. 2020-10-08 17:07:30 -07:00
webhooks bitbucket2: Format user info consistently. 2020-09-23 15:31:38 -07:00
worker queue: Rename queue_size, and update for all local queues. 2020-10-09 20:40:39 -07:00
__init__.py
apps.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
context_processors.py i18n: Don't include email tags in translation strings. 2020-09-25 15:53:26 -07:00
decorator.py zulip_otp_required: Don't 2fa logged out users. 2020-10-01 14:46:46 -07:00
filters.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00
forms.py urls: Remove unused URL names and shorten others. 2020-09-22 10:46:28 -07:00
logging_handlers.py models: Force the translated role into a translated string. 2020-09-03 17:26:54 -07:00
middleware.py middleware: Move locale-setting before domain checking. 2020-09-14 22:16:09 -07:00
models.py realm: Add wildcard_mention_policy setting. 2020-10-01 12:18:03 -07:00
signals.py python: Sort imports with isort. 2020-06-11 16:45:32 -07:00