【文件属性】:
文件名称:iron_cache_ruby:IronCache的Ruby客户端
文件大小:12KB
文件格式:ZIP
更新时间:2021-05-16 17:23:35
Ruby
IronCache Ruby客户端
入门
1.安装gem:
gem install iron_cache
2.设置Iron.io凭据: ://dev.iron.io/cache/reference/configuration/
3.创建一个IronCache客户端对象:
@client = IronCache::Client.new
基础知识
获取一个缓存对象
您可以根据需要拥有任意数量的缓存,每个缓存都有自己独特的项目集。
@cache = @client.cache("my_cache")
现在您可以使用它:
将项目放入缓存中:
@cache.put("mykey", "hello world!")
从缓存中获取项目:
item = @cache.get("mykey")
p item.value
从缓存中删除一个项目:
res = msg.delete
【文件预览】:
iron_cache_ruby-master
----iron_cache.gemspec(1KB)
----lib()
--------iron_cache.rb(127B)
--------iron_cache()
----Gemfile(39B)
----Rakefile(472B)
----test()
--------test_base.rb(1KB)
--------tmp.rb(168B)
--------load_er_up.rb(1024B)
--------quick_run.rb(669B)
--------test_errors.rb(329B)
--------test_memcached.rb(820B)
--------test_iron_cache.rb(6KB)
--------test_performance.rb(419B)
----README.md(2KB)
----Gemfile.lock(572B)
----.gitignore(78B)