cache.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:bowtie 作者: jwkvam 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号