Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Add ability to get multiple memcached keys at the same time.

#1853

Memcached supports the ability to get multiple keys at the same time. The memcached-client library included in rails has that functionality, but MemCacheStore doesn't expose it.

The attached patch adds MemCacheStore#read_multi.

Reported by Joe Van Dyk · February 3rd, 2009 @ 12:47 AM

State: resolved
Milestone: 2.x
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Eric
    Eric
    • Tag changed from 2.3, patch to 2.3, cache, memcache, mem_cache_store, patch

    +1 Looks good.

    What happens if you request a key that doesn't exist as part of the list?

    @cache.read_multi('foo', 'bar', 'baz')

    February 3rd, 2009 @ 01:12 AM

  2. Joe Van Dyk
    Joe Van Dyk

    CACHE.write 'foo', '1' Cache write: foo => true

    CACHE.write 'goo', '2' Cache write: goo => true

    CACHE.read_multi 'foo', 'eric' => {"foo"=>"1"}

    CACHE.read_multi 'dontexist' => {}

    Doesn't return a result for it.

    February 3rd, 2009 @ 01:23 AM

  3. Joe Van Dyk
    Joe Van Dyk

    Doh, better formatting:

    
    >> CACHE.write 'foo', '1'
    Cache write: foo
    => true
    
    >> CACHE.read_multi 'foo', 'eric'
    => {"foo"=>"1"}
    
    >> CACHE.read_multi 'dontexist'
    => {}
    

    February 3rd, 2009 @ 01:25 AM

  4. Pratik
    Pratik
    • Assigned user set to Jeremy Kemper

    May 18th, 2009 @ 07:59 PM

  5. Joe Van Dyk
    Joe Van Dyk

    It looks like this was merged in Feb 2009 in commit ad857712. Mark as resolved?

    December 28th, 2009 @ 07:11 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to resolved

    December 28th, 2009 @ 07:20 PM

  7. bingbing