Skip to content
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

Process the mdns messages semi parallel #537

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

marcelveldt
Copy link
Collaborator

Adjust the processing of mdns events for operational matter nodes a small bit.
We want to process them in sequential order but at the same time not block processing if one node is just slow to respond or whatever.

This introduces a queue and queue processing task per node (or strictly speaking, mdns name)

@marcelveldt marcelveldt added the maintenance Code (quality) improvement or small enhancement which not a new feature label Feb 7, 2024
Copy link
Collaborator

@agners agners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lifetime of the asyncio tasks is also better managed, I like this approach 👍

@marcelveldt
Copy link
Collaborator Author

Adjusted the code a bit to fix the (strangely) failing pytest

@marcelveldt marcelveldt merged commit 415fe93 into main Feb 7, 2024
@marcelveldt marcelveldt deleted the semi-parallel-processing-mdns branch February 7, 2024 18:21
if existing := self._mdns_queues.get(name):
queue = existing[0]
else:
# we want mdns messages to be processes sequentially PER NODE but in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Code (quality) improvement or small enhancement which not a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants