neilmiddleton/redcache — pull request #1 by wuputah (2014-10-17 22:49:45+00:00)
Title: Allow passing args into Redcache.cache

These values will be passed to the block, which might be executed inside
a thread. Use these values when you need to reference an object inside
the block that might be altered by your application. For maximum safety,
any variable you reference inside the block should be passed in.

Redcache.cache "user-#{id}", api, id do |api, id|
api.user.find(id)
end

Note that this does not guarantee thread safety of these objects -
objects that used inside these blocks must still operate in a
thread-safe manner.