-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-48885: Add support for configuring number of messages to be consumed and timeout in salobj Remote/SalInfo. #309
Conversation
0db7aa4
to
30cc7b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
python/lsst/ts/salobj/sal_info.py
Outdated
f"Failed to deserialize {schema_resolution_errors[kafka_name]} samples of " | ||
f"{kafka_name}. Check schema compatibility!" | ||
for message in messages: | ||
message_error = message.error() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping message processing leads to quite big indentation, which makes code harder to read. Can you please create a method to process messages, so the code (assuming it's called _process_message) will shrink to:
for message in messages:
self._process_messaeg(message)
doc/news/README.rst
Outdated
@@ -0,0 +1,40 @@ | |||
Recording Changes | |||
================= | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an empty space. Not a big deal, but if you can get rid of those (:%s/ *$//g in vim), that will save some bits.
…xpose parameters to allow users to select the number of messages and timeout. By default this uses num_messages=1 and timeout=0.1, which fallbacks to the behaviour of pool with timeout=0.1. Users must be careful when using this feature as it will affect command and event response in some non-obvious way.
…nd timeout on the read loop.
…sages and consume_messages_timeout.
…ages and consume_messages_timeout.
…ages_timeout has the expected behavior.
…num_messages and consume_messages_timeout.
30cc7b4
to
f7f9e5c
Compare
No description provided.