@@ -202,17 +202,20 @@ def handle_push_response(self, response, **kwargs):
202
202
if msg_type in _INVALIDATION_MESSAGE and self .invalidation_push_handler_func :
203
203
return self .invalidation_push_handler_func (response )
204
204
if msg_type in _MOVING_MESSAGE and self .node_moving_push_handler_func :
205
+ # TODO: PARSE latest format when available
205
206
host , port = response [2 ].decode ().split (":" )
206
207
ttl = response [1 ]
207
208
id = 1 # Hardcoded value until the notification starts including the id
208
209
notification = NodeMovingEvent (id , host , port , ttl )
209
210
return self .node_moving_push_handler_func (notification )
210
211
if msg_type in _MAINTENANCE_MESSAGES and self .maintenance_push_handler_func :
211
212
if msg_type in _MIGRATING_MESSAGE :
213
+ # TODO: PARSE latest format when available
212
214
ttl = response [1 ]
213
215
id = 2 # Hardcoded value until the notification starts including the id
214
216
notification = NodeMigratingEvent (id , ttl )
215
217
elif msg_type in _MIGRATED_MESSAGE :
218
+ # TODO: PARSE latest format when available
216
219
id = 3 # Hardcoded value until the notification starts including the id
217
220
notification = NodeMigratedEvent (id )
218
221
else :
@@ -260,17 +263,20 @@ async def handle_push_response(self, response, **kwargs):
260
263
return await self .invalidation_push_handler_func (response )
261
264
if msg_type in _MOVING_MESSAGE and self .node_moving_push_handler_func :
262
265
# push notification from enterprise cluster for node moving
266
+ # TODO: PARSE latest format when available
263
267
host , port = response [2 ].split (":" )
264
268
ttl = response [1 ]
265
269
id = 1 # Hardcoded value for async parser
266
270
notification = NodeMovingEvent (id , host , port , ttl )
267
271
return await self .node_moving_push_handler_func (notification )
268
272
if msg_type in _MAINTENANCE_MESSAGES and self .maintenance_push_handler_func :
269
273
if msg_type in _MIGRATING_MESSAGE :
274
+ # TODO: PARSE latest format when available
270
275
ttl = response [1 ]
271
276
id = 2 # Hardcoded value for async parser
272
277
notification = NodeMigratingEvent (id , ttl )
273
278
elif msg_type in _MIGRATED_MESSAGE :
279
+ # TODO: PARSE latest format when available
274
280
id = 3 # Hardcoded value for async parser
275
281
notification = NodeMigratedEvent (id )
276
282
return await self .maintenance_push_handler_func (notification )
@@ -283,7 +289,7 @@ def set_invalidation_push_handler(self, invalidation_push_handler_func):
283
289
"""Set the invalidation push handler function"""
284
290
self .invalidation_push_handler_func = invalidation_push_handler_func
285
291
286
- def set_node_moving_push_handler_func (self , node_moving_push_handler_func ):
292
+ def set_node_moving_push_handler (self , node_moving_push_handler_func ):
287
293
self .node_moving_push_handler_func = node_moving_push_handler_func
288
294
289
295
def set_maintenance_push_handler (self , maintenance_push_handler_func ):
0 commit comments