Sha256: 9352d914e327543035823a02f3eefe740d641fd42aa0afd0aa18cf637d0e7d0e

Contents?: true

Size: 656 Bytes

Versions: 4

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

class ActiveRedisDB::PubSub < ActiveRedisDB::Base
  class << self

    def publish(channel, message)
      client.publish(channel, message)
    end

    def subscribed?
      client.subscribed?
    end

    def subscribe(*channels, &block)
      client.subscribe(channels, &block)
    end

    def unsubscribe(*channels)
      client.unsubscribe(channels)
    end

    def match_subscribe(*channels, &block)
      client.psubscribe(channels, &block)
    end

    def match_unsubscribe(*channels)
      client.punsubscribe(channels)
    end

    def state(command, *args)
      client.pubsub(command, args)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_redis_db-1.1.0 lib/active_redis_db/pub_sub.rb
active_redis_db-1.0.2 lib/active_redis_db/pub_sub.rb
active_redis_db-1.0.1 lib/active_redis_db/pub_sub.rb
active_redis_db-1.0.0 lib/active_redis_db/pub_sub.rb