-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-add support for memory_store #161
Conversation
Could you also add a test for fetch_multi when using the MemoryStore? |
|
||
def fetch_multi(keys, &block) | ||
results = @cache_backend.read_multi(keys) | ||
hit_keys = results.reject {|key, value| value == nil }.keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary. I think it omits keys from the hash if they aren't found in the cache.
LGTM other than my 2 comments. |
Get the same issue with dalli gem /gems/identity_cache-0.2.0/lib/identity_cache/cache_fetcher.rb:49:in `cas_multi': undefined method `cas_multi' for #<ActiveSupport::Cache::DalliStore:0x007fb15c667000> (NoMethodError) Would be great if it still would be possible to use alternativ memcached clients. |
@RobWu we are moving towards CAS over SET to avoid race conditions that can potentially return wrong data, is there a version of Dalli that supports CAS? |
There is cas but can't find multi_cas http://www.rubydoc.info/github/mperham/dalli/Dalli/Client#cas-instance_method |
Found something: |
Will look into it tomorrow.. |
I am not sure if I like this approach. If thats too hard, we maybe should drop support to the other adapters, and raise an error if the adapter is not memcached_store. |
@arthurnn is that just a critique of the |
@fbogsany sorry, I should've been more clear about it.. Yep.. the name |
@arthurnn groovy - does |
I like |
|
🐑 |
Re-add support for memory_store
❤️ ❤️ ❤️ |
PR #154 removed support for
memory_store
, due to the requirement forcas
/cas_multi
.This adds a
MemoryFetcher
ands uses it instead ofCacheFetcher
if thecache_backend
doesn't respond tocas
andcas_multi
.Fixes #160
@arthurnn @dylanahsmith for review /cc @camilo