def save(key, value):
"""Store the key value pair.
Parameters
----------
key : str
The key to determine where it's stored, you'll need this to load the value later.
value : object
The value to store in the cache.
Returns
-------
None
"""
signal = 'cache_save'
if flask.has_request_context():
emit(signal, {'key': pack(key), 'data': pack(value)})
else:
sio = flask.current_app.extensions['socketio']
sio.emit(signal, {'key': pack(key), 'data': pack(value)})
eventlet.sleep()
评论列表
文章目录