Skip to content

Commit

Permalink
Merge pull request #1 from caseyf/patch-1
Browse files Browse the repository at this point in the history
Add multiget support.
  • Loading branch information
outcassed committed Aug 8, 2012
2 parents d3f7f9a + ea1f5e6 commit dc9cee5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/openfeint/memcached/Memcached.java
Expand Up @@ -217,6 +217,15 @@ public IRubyObject get(ThreadContext context, IRubyObject key) {
}
return value;
}

@JRubyMethod
public IRubyObject multiget(ThreadContext context, IRubyObject keys) {
RubyHash results = RubyHash.newHash(ruby);
for (Map.Entry<String, IRubyObject> entry : client.getBulk(keys.convertToArray(), transcoder).entrySet()) {
results.op_aset(context, entry.getKey(), entry.getValue());
}
return results;
}

@JRubyMethod
public IRubyObject incr(ThreadContext context, IRubyObject key) {
Expand Down

0 comments on commit dc9cee5

Please sign in to comment.