class Redis::SubscribedClient
def subscription(start, stop, channels, block)
def subscription(start, stop, channels, block) sub = Subscription.new(&block) begin @client.call_loop([start, *channels]) do |line| type, *rest = line sub.callbacks[type].call(*rest) break if type == stop && rest.last == 0 end ensure send(stop) end end