File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626import threading
2727import warnings
2828from abc import abstractmethod
29- from collections import OrderedDict
3029from typing import (
3130 TYPE_CHECKING ,
3231 Callable ,
@@ -302,7 +301,7 @@ def __init__(
302301 self .port = port
303302 self .multicast = self .addr in (None , _MDNS_ADDR , _MDNS_ADDR6 )
304303 self .question_type = question_type
305- self ._pending_handlers : OrderedDict [Tuple [str , str ], ServiceStateChange ] = OrderedDict ()
304+ self ._pending_handlers : Dict [Tuple [str , str ], ServiceStateChange ] = {}
306305 self ._service_state_changed = Signal ()
307306 self .query_scheduler = QueryScheduler (self .types , delay , _FIRST_QUERY_DELAY_RANDOM_INTERVAL )
308307 self .done = False
@@ -551,5 +550,6 @@ def async_update_records_complete(self) -> None:
551550
552551 This method will be run in the event loop.
553552 """
554- while self ._pending_handlers :
555- self .queue .put (self ._pending_handlers .popitem (False ))
553+ for pending in self ._pending_handlers .items ():
554+ self .queue .put (pending )
555+ self ._pending_handlers .clear ()
Original file line number Diff line number Diff line change @@ -89,8 +89,9 @@ def async_update_records_complete(self) -> None:
8989
9090 This method will be run in the event loop.
9191 """
92- while self ._pending_handlers :
93- self ._fire_service_state_changed_event (self ._pending_handlers .popitem (False ))
92+ for pending in self ._pending_handlers .items ():
93+ self ._fire_service_state_changed_event (pending )
94+ self ._pending_handlers .clear ()
9495
9596
9697class AsyncZeroconfServiceTypes (ZeroconfServiceTypes ):
You can’t perform that action at this time.
0 commit comments