mps.cache.DataCache
表示 MATLAB 代码中的缓存概念
说明
mps.cache.DataCache
表示 MATLAB® 代码中的缓存概念。它是一个抽象类,用作每个特定于持久性提供程序的数据缓存类的超类。
目前,仅支持 Redis™ 和 MATLAB 两个持久性提供程序。因此,缓存对象的类型将为 mps.cache.RedisCache
或 mps.cache.MATFileCache
。
创建对象
使用 mps.cache.connect
创建 mps.cache.DataCache
的特定于持久性提供程序的子类。
属性
有关属性,请参阅特定于提供程序的子类。
对象函数
示例
连接到 Redis 缓存
启动使用 Redis 作为持久性提供程序的持久性服务。该服务需要一个连接名称和一个开放端口。该服务运行后,您可以使用连接名称连接到该服务并创建缓存。
ctrl = mps.cache.control('myRedisConnection','Redis','Port',4519); start(ctrl) c = mps.cache.connect('myCache', 'Connection', 'myRedisConnection')
c = RedisCache with properties: Host: 'localhost' Port: 4519 Name: 'myCache' Operations: "read | write | create | update" LocalKeys: {} Connection: 'myRedisConnection' Use getp instead of dot notation to access properties.
版本历史记录
在 R2018b 中推出