Module: Redisse::Server::Redis Private

Included in:
Redisse::Server
Defined in:
lib/redisse/server/redis.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary (collapse)

Instance Method Details

- (Object) ensure_pubsub

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
19
20
# File 'lib/redisse/server/redis.rb', line 14

def ensure_pubsub
  return if defined? @pubsub
  @pubsub = redis.pubsub
  @pubsub_errbacks = []
  @pubsub.on(:disconnected, &method(:on_redis_close))
  EM::Synchrony.sync(@pubsub)
end

- (Object) on_redis_close

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
# File 'lib/redisse/server/redis.rb', line 22

def on_redis_close
  @pubsub_errbacks.each(&:call)
  @pubsub_errbacks.clear
end

- (Object) pubsub(&on_disconnected)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
# File 'lib/redisse/server/redis.rb', line 7

def pubsub(&on_disconnected)
  ensure_pubsub
  return false unless @pubsub.connected?
  @pubsub_errbacks << on_disconnected
  true
end

- (Object) pubsub_subcribe(channels, callback)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
31
# File 'lib/redisse/server/redis.rb', line 27

def pubsub_subcribe(channels, callback)
  channels.each do |channel|
    @pubsub.subscribe(channel, callback)
  end
end

- (Object) pubsub_unsubscribe_proc(channels, callback)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
36
37
# File 'lib/redisse/server/redis.rb', line 33

def pubsub_unsubscribe_proc(channels, callback)
  channels.each do |channel|
    @pubsub.unsubscribe_proc(channel, callback)
  end
end

- (Object) redis

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



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

def redis
  @redis ||= EM::Hiredis.connect(redisse.redis_server)
end