redis-store/redis-activesupport — pull request #10 by samleb (2014-03-23 18:51:36+00:00)
Title: Use Lua scripting when available to implement delete_matched

The idea behind this pull request is to improve `delete_matched` by pushing the algorithm to the Redis server(s) instead of doing it on the Ruby side, to improve both memory and CPU consumption.

:warning: the current implementation of `delete_matched` will throw a `SystemStackError`, at least on MRI, if the set of matching keys is bigger than ~130K elements (see below).
This pull request doesn't address this issue, at least yet... I'd be pleased to do so.

Using MRI (whatever the version IIRC):
```ruby
# Excerpt from `delete_matched` implementation
@data.del(*keys)

# Defining a method with variadic arguments
def foo(*args) end
# Calling this method with more than 130k argument
foo(*Array.new(140_000))
# SystemStackError: stack level too deep
```