RecordUpdateListener now uses update_records instead of update_record#419
Conversation
a16a69f to
b635880
Compare
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
==========================================
+ Coverage 95.62% 95.83% +0.20%
==========================================
Files 4 4
Lines 3338 3385 +47
Branches 402 407 +5
==========================================
+ Hits 3192 3244 +52
+ Misses 89 84 -5
Partials 57 57
Continue to review full report at Codecov.
|
|
There is still a race condition since we update the cache after we call We need a way to tell the ServiceBrowser to process pending events after the cache has been updated |
049cb13 to
4a6d5de
Compare
5203b2c to
562c6ad
Compare
|
0bf5150 to
14b4e4d
Compare
|
This one needs another set of 👀 I'm going to try to break out the simpler changes into smaller chunks though first to reduce the size of the review |
- Prepares for the change from update_record to update_records in python-zeroconf#419
- This will be fixed in python-zeroconf#419
4a9de0f to
c7f919a
Compare
- This change is not enough to remove the too-many-branches pylint disable, however when combined with python-zeroconf#419 it should no longer be needed
- Adds `add_records` and `remove_records` to `DNSCache` to permit multiple records to be added or removed in one call - This change is not enough to remove the too-many-branches pylint disable, however when combined with #419 it should no longer be needed
b6a07b3 to
3371d8b
Compare
|
May be possible to merge |
|
I was initially worried about this change, but it turns out the problem is actually #476 so this should be good to go once the other issue is fixed. |
This allows the listener to receive all the records that have been updated in a single transaction such as a packet or cache expiry. `update_record` has been deprecated in favor of `update_records` A compatibility shim exists to ensure classes that use `RecordUpdateListener` as a base class continue to have `update_record` called, however they should be updated as soon as possible. A new method `update_records_complete` is now called on each listener when all listeners have completed processing updates and the cache has been updated. This allows ServiceBrowsers to delay calling handlers until they are sure the cache has been updated as its a common pattern to call for ServiceInfo when a ServiceBrowser handler fires.
|
I think we can turn on some more of the PyPy disabled tests as they should be less flakey after this and the other synchronization fixes that I just merged |
- The root cause of the test failing should be fixed by python-zeroconf#419 and python-zeroconf#477
This allows the listener to receive all the records that have
been updated in a single transaction such as a packet or
cache expiry.
update_recordhas been deprecated in favor ofupdate_recordsA compatibility shim exists to ensure classes that use
RecordUpdateListeneras a base class continue to haveupdate_recordcalled, however they should be updatedas soon as possible.
A new method
update_records_completeis now called on eachlistener when all listeners have completed processing updates
and the cache has been updated. This allows ServiceBrowsers
to delay calling handlers until they are sure the cache
has been updated as its a common pattern to call for
ServiceInfo when a ServiceBrowser handler fires.
Fixes #416
Fixes #431
Closes #418
Fixes #456
Closes #457