zulip/zerver
Alex Vandiver f9358d5330 queue: Switch batch interface to use the channel.consume iterator.
This low-level interface allows consuming from a queue with timeouts.
This can be used to either consume in batches (with an upper timeout),
or one-at-a-time.  This is notably more performant than calling
`.get()` repeatedly (what json_drain_queue does under the hood), which
is "*highly discouraged* as it is *very inefficient*"[1].

Before this change:
```
$ ./manage.py queue_rate --count 10000 --batch
Purging queue...
Enqueue rate: 11158 / sec
Dequeue rate: 3075 / sec
```

After:
```
$ ./manage.py queue_rate --count 10000 --batch
Purging queue...
Enqueue rate: 11511 / sec
Dequeue rate: 19938 / sec
```

[1] https://www.rabbitmq.com/consumers.html#fetching
2020-10-11 14:19:40 -07:00
..
data_import import_util: Migrate from run_parallel to multiprocessing. 2020-09-14 16:22:23 -07:00
lib queue: Switch batch interface to use the channel.consume iterator. 2020-10-11 14:19:40 -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: Switch batch interface to use the channel.consume iterator. 2020-10-11 14:19:40 -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: Switch batch interface to use the channel.consume iterator. 2020-10-11 14:19:40 -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