File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ def __init__(self, socket_read_size):
40
40
raise ValkeyError ("libvalkey is not installed" )
41
41
self .socket_read_size = socket_read_size
42
42
self ._buffer = bytearray (socket_read_size )
43
+ self .invalidations_push_handler_func = None
43
44
44
45
def __del__ (self ):
45
46
try :
@@ -144,6 +145,9 @@ def read_response(self, disable_decoding=False):
144
145
raise response [0 ]
145
146
return response
146
147
148
+ def set_invalidation_push_handler (self , invalidations_push_handler_func ):
149
+ self .invalidations_push_handler_func = invalidations_push_handler_func
150
+
147
151
148
152
class _AsyncLibvalkeyParser (AsyncBaseParser ):
149
153
"""Async implementation of parser class for connections using libvalkey"""
@@ -155,6 +159,7 @@ def __init__(self, socket_read_size: int):
155
159
raise ValkeyError ("libvalkey is not available." )
156
160
super ().__init__ (socket_read_size = socket_read_size )
157
161
self ._reader = None
162
+ self .invalidations_push_handler_func = None
158
163
159
164
def on_connect (self , connection ):
160
165
import libvalkey
@@ -228,3 +233,6 @@ async def read_response(
228
233
):
229
234
raise response [0 ]
230
235
return response
236
+
237
+ def set_invalidation_push_handler (self , invalidations_push_handler_func ):
238
+ self .invalidations_push_handler_func = invalidations_push_handler_func
You can’t perform that action at this time.
0 commit comments