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

feat: improve AsyncServiceBrowser performance #1273

Merged
merged 1 commit into from Sep 14, 2023
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Sep 14, 2023

provide default handler for async_update_records_complete in _ServiceBrowserBase

async_update_records_complete is no longer an abstract method in _ServiceBrowserBase and a default handler is now provided which was originally in AsyncServiceBrowser. This allows us to cythonize the function and use the fast PyDict methods since its called so frequently when a browser is running.

It is still expected that async_update_records_complete can be overridden in subclasses, but it is recommended to subclass ServiceBrowser or AsyncServiceBrowser directly instead of _ServiceBrowserBase since the _ indicates _ServiceBrowserBase is protected and its internal api is not public (or stable)

…erviceBrowserBase

async_update_records_complete is no longer an abstract method and
a default handler is now provided which was originally in
AsyncServiceBrowser.

It is still expected that async_update_records_complete can
be overridden in subclasses, but it is recommended to subclass
ServiceBrowser or AsyncServiceBrowser directly instead of
_ServiceBrowserBase since the _ indicates _ServiceBrowserBase
is protected and its internal api is not public
@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
src/zeroconf/asyncio.py ø
src/zeroconf/__init__.py 100.00%
src/zeroconf/_services/browser.py 100.00%

📢 Thoughts on this report? Let us know!.

@bdraco bdraco merged commit 0c88ecf into master Sep 14, 2023
34 checks passed
@bdraco bdraco deleted the collapse_browser_base branch September 14, 2023 14:32
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.

None yet

1 participant