Class: Redis::SubscribedClient

Inherits:
Object
  • Object
show all
Defined in:
lib/redis/subscribe.rb

Instance Method Summary (collapse)

Constructor Details

- (SubscribedClient) initialize(client)

Returns a new instance of SubscribedClient



3
4
5
# File 'lib/redis/subscribe.rb', line 3

def initialize(client)
  @client = client
end

Instance Method Details

- (Object) call(command)



7
8
9
# File 'lib/redis/subscribe.rb', line 7

def call(command)
  @client.process([command])
end

- (Object) psubscribe(*channels, &block)



15
16
17
# File 'lib/redis/subscribe.rb', line 15

def psubscribe(*channels, &block)
  subscription("psubscribe", "punsubscribe", channels, block)
end

- (Object) punsubscribe(*channels)



23
24
25
# File 'lib/redis/subscribe.rb', line 23

def punsubscribe(*channels)
  call([:punsubscribe, *channels])
end

- (Object) subscribe(*channels, &block)



11
12
13
# File 'lib/redis/subscribe.rb', line 11

def subscribe(*channels, &block)
  subscription("subscribe", "unsubscribe", channels, block)
end

- (Object) unsubscribe(*channels)



19
20
21
# File 'lib/redis/subscribe.rb', line 19

def unsubscribe(*channels)
  call([:unsubscribe, *channels])
end