Skip to content

feat: improve AsyncServiceBrowser performance#1273

Merged
bdraco merged 1 commit into
masterfrom
collapse_browser_base
Sep 14, 2023
Merged

feat: improve AsyncServiceBrowser performance#1273
bdraco merged 1 commit into
masterfrom
collapse_browser_base

Conversation

@bdraco
Copy link
Copy Markdown
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
Copy Markdown

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
@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.

1 participant