File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 Sync ,
4545 Transaction
4646)
47+ from kazoo .protocol .states import Callback
48+ from kazoo .protocol .states import EventType
4749from kazoo .protocol .states import KazooState
4850from kazoo .protocol .states import KeeperState
51+ from kazoo .protocol .states import WatchedEvent
4952from kazoo .retry import KazooRetry
5053from kazoo .security import ACL
5154from kazoo .security import OPEN_ACL_UNSAFE
@@ -305,9 +308,20 @@ def _reset(self):
305308 self ._protocol_version = None
306309
307310 def _reset_watchers (self ):
311+ watchers = []
312+ for child_watchers in six .itervalues (self ._child_watchers ):
313+ watchers .extend (child_watchers )
314+
315+ for data_watchers in six .itervalues (self ._data_watchers ):
316+ watchers .extend (data_watchers )
317+
308318 self ._child_watchers = defaultdict (set )
309319 self ._data_watchers = defaultdict (set )
310320
321+ ev = WatchedEvent (EventType .NONE , self ._state , None )
322+ for watch in watchers :
323+ self .handler .dispatch_callback (Callback ("watch" , watch , (ev ,)))
324+
311325 def _reset_session (self ):
312326 self ._session_id = None
313327 self ._session_passwd = b'\x00 ' * 16
Original file line number Diff line number Diff line change @@ -93,13 +93,19 @@ class EventType(object):
9393 removed). This event does not indicate the data for a child
9494 node has changed, which must have its own watch established.
9595
96+ .. attribute:: NONE
97+
98+ The connection state has been altered.
99+
96100 """
97101 CREATED = 'CREATED'
98102 DELETED = 'DELETED'
99103 CHANGED = 'CHANGED'
100104 CHILD = 'CHILD'
105+ NONE = 'NONE'
101106
102107EVENT_TYPE_MAP = {
108+ - 1 :EventType .NONE ,
103109 1 : EventType .CREATED ,
104110 2 : EventType .DELETED ,
105111 3 : EventType .CHANGED ,
You can’t perform that action at this time.
0 commit comments