This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
⌘T | 前往文件 |
⌘⌃P | 前往项目 |
⌘R | 前往 method |
⌘⇧P | 命令提示 |
require 'redis' | |
require 'redis-store' | |
require 'redis-activesupport' | |
require 'active_support' | |
require 'active_support/cache/dalli_store' | |
CACHE = ::ActiveSupport::Cache::RedisStore.new host: '192.168.1.20', db: 0, port: 6379, namespace: 'demo' | |
n = 10000 | |
n.times {|i| CACHE.write "user:#{i}:counter", i * i } |
require 'dalli' | |
require 'active_support' | |
require 'active_support/cache/dalli_store' | |
CACHE = ::ActiveSupport::Cache::DalliStore.new 'localhost', namespace: 'demo' | |
n = 10000 | |
n.times {|i| CACHE.write "user:#{i}:counter", i * i } | |
def read_in_batch(total, batch_size) |
This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
⌘T | 前往文件 |
⌘⌃P | 前往项目 |
⌘R | 前往 method |
⌘⇧P | 命令提示 |