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
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.
REF: https://github.com/redis/redis-rb/issues/122