File tree 2 files changed +7
-6
lines changed
Filter options
2 files changed +7
-6
lines changed
Original file line number Diff line number Diff line change 26
26
import threading
27
27
import warnings
28
28
from abc import abstractmethod
29
- from collections import OrderedDict
30
29
from typing import (
31
30
TYPE_CHECKING ,
32
31
Callable ,
@@ -302,7 +301,7 @@ def __init__(
302
301
self .port = port
303
302
self .multicast = self .addr in (None , _MDNS_ADDR , _MDNS_ADDR6 )
304
303
self .question_type = question_type
305
- self ._pending_handlers : OrderedDict [Tuple [str , str ], ServiceStateChange ] = OrderedDict ()
304
+ self ._pending_handlers : Dict [Tuple [str , str ], ServiceStateChange ] = {}
306
305
self ._service_state_changed = Signal ()
307
306
self .query_scheduler = QueryScheduler (self .types , delay , _FIRST_QUERY_DELAY_RANDOM_INTERVAL )
308
307
self .done = False
@@ -551,5 +550,6 @@ def async_update_records_complete(self) -> None:
551
550
552
551
This method will be run in the event loop.
553
552
"""
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:
89
89
90
90
This method will be run in the event loop.
91
91
"""
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 ()
94
95
95
96
96
97
class AsyncZeroconfServiceTypes (ZeroconfServiceTypes ):
You can’t perform that action at this time.
0 commit comments