Skip to content

Version03 本地缓存 #41

@TheTurtle2020

Description

@TheTurtle2020

今天在复盘 RPC 的时候,发现一个关于【本地缓存】的问题。

根据查看源码和询问 GPT,我目前的理解,其实 CuratorCache 本就提供了本地缓存,这个本地缓存本质上也是 Map<String path, ChildData data>,被封装为了 CuratorCacheStorage。

节选源码中的介绍:

CuratorCache: A utility that attempts to keep the data from a node locally cached. Optionally the entire tree of children below the node can also be cached.

所以为什么还要再自定义 ServiceCache 作为本地缓存呢?而不是直接使用 CuratorCache 提供的 APIs 获取呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions