Skip to content

feat: speed up adding and removing RecordUpdateListeners#1253

Merged
bdraco merged 5 commits into
masterfrom
record_manager_private
Sep 3, 2023
Merged

feat: speed up adding and removing RecordUpdateListeners#1253
bdraco merged 5 commits into
masterfrom
record_manager_private

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented Sep 3, 2023

Listeners were stored in a list which meant a linear search had to happen to remove them. We add/remove these quite a bit when resolving a service, also ESPHome churns these quite a bit when a device is offline.

Technically breaking change: Zeroconf.listeners now returns a set instead of a list
Technically breaking change: ServiceInfo.__eq__ is now the default python implementation as it wasn't hashable otherwise and comparing on name was wrong since it wasn't case aware

Comment thread src/zeroconf/_core.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 3, 2023

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
src/zeroconf/_services/info.py ø
src/zeroconf/__init__.py 100.00%
src/zeroconf/_core.py 100.00%
src/zeroconf/_handlers/record_manager.py 100.00%

📢 Thoughts on this report? Let us know!.

@bdraco bdraco merged commit 22e4a29 into master Sep 3, 2023
@bdraco bdraco deleted the record_manager_private branch September 3, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant