Only wake up the query loop when there is a change in the next query time by bdraco · Pull Request #818 · python-zeroconf/python-zeroconf

@bdraco

The ServiceBrowser query loop (async_browser_task) was being awoken on
every packet because it was using zeroconf.async_wait which wakes
up on every new packet. We only need to awaken the loop when the next time
we are going to send a query has changed.

fixes #814 fixes #768

@bdraco bdraco changed the title Only wake up the query loop when there is a change in the next query time. Only wake up the query loop when there is a change in the next query time

Jun 23, 2021

@bdraco

@codecov-commenter

@bdraco

While this is much better and reliable, the scheduling is still sub-optimal because we will schedule a query in the future when a PTR will be close to expiring, but if the PTR is seen again between when it was scheduled and we ask again, we still ask.

@bdraco bdraco marked this pull request as ready for review

June 23, 2021 03:06

@bdraco bdraco deleted the abtract_query_scheduler branch

June 23, 2021 03:06