mloughran / em-hiredis

Eventmachine redis client
MIT License
221 stars 63 forks source link

"stack level too deep" error with large splatted array parameters #44

Open saarp opened 9 years ago

saarp commented 9 years ago

There seems to be a well-know issue with passing too many parameters to a function in Ruby. It's easy to hit this with when using Redis. The Redis client appears to have a way around this by passing a single array type as an argument. I am wondering how i can achieve the same with EM::Hiredis.

require "em-hiredis"

EM::run do
    redis = EM::Hiredis::connect("redis://localhost:6379/5")

    bigRange = (1..1000000)
    p "Starting big sunion."
    redis.sunion(*bigRange)
    # now "stack level too deep" error occurs
    p "Got out alive."
end

REF: https://github.com/redis/redis-rb/issues/122