I am having channels which are coming dynamically from another file .I have to subscribe to all the channels.But I am not able to loop through redis subscribe
config=["channel1","channel2","channel3"]
config.each do |ch|
$redis.subscribe(ch) do |on|
#on.message......
end
end
But it subscribes to the first element in loop.The "config" can vary dynamically.