module Lite::Redis::PubSubHelper

Public Instance Methods

match_subscribe(*channels, timeout: nil, &block) click to toggle source
# File lib/lite/redis/helpers/pub_sub_helper.rb, line 27
def match_subscribe(*channels, timeout: nil, &block)
  if timeout.nil?
    client.psubscribe(*channels, &block)
  else
    client.psubscribe_with_timeout(timeout, *channels, &block)
  end
end
match_unsubscribe(*channels) click to toggle source
# File lib/lite/redis/helpers/pub_sub_helper.rb, line 35
def match_unsubscribe(*channels)
  client.punsubscribe(*channels)
end
publish(channel, message) click to toggle source
# File lib/lite/redis/helpers/pub_sub_helper.rb, line 7
def publish(channel, message)
  client.publish(channel, message)
end
state(command, *args) click to toggle source
# File lib/lite/redis/helpers/pub_sub_helper.rb, line 39
def state(command, *args)
  client.pubsub(command, *args)
end
subscribe(*channels, timeout: nil, &block) click to toggle source
# File lib/lite/redis/helpers/pub_sub_helper.rb, line 15
def subscribe(*channels, timeout: nil, &block)
  if timeout.nil?
    client.subscribe(*channels, &block)
  else
    client.subscribe_with_timeout(timeout, *channels, &block)
  end
end
subscribed?() click to toggle source
# File lib/lite/redis/helpers/pub_sub_helper.rb, line 11
def subscribed?
  client.subscribed?
end
unsubscribe(*channels) click to toggle source
# File lib/lite/redis/helpers/pub_sub_helper.rb, line 23
def unsubscribe(*channels)
  client.unsubscribe(*channels)
end