Class: Redis::Bin::RubyRedisServer

Inherits:
EventMachine::Connection
  • Object
show all
Includes:
Connection, Protocol, Sender, Strict
Defined in:
lib/redis/bin.rb

Instance Method Summary collapse

Methods included from Sender

#send_redis

Methods included from Protocol

#receive_data, #redis_DISCARD, #redis_EXEC, #redis_MULTI, #redis_UNWATCH, #redis_WATCH, #unbind

Methods included from Connection

#redis_AUTH, #redis_ECHO, #redis_PING, #redis_QUIT, #redis_SELECT

Methods included from Strict

#redis_f, #redis_i, #redis_t

Methods included from NotStrict

#redis_f, #redis_i, #redis_pos_i, #redis_t

Constructor Details

#initialize(logger, databases, config = {}) ⇒ RubyRedisServer

Returns a new instance of RubyRedisServer.



16
17
18
19
20
21
22
# File 'lib/redis/bin.rb', line 16

def initialize logger, databases, config={}
  @logger = logger
  @databases = databases
  @database = databases[0]
  @config = config
  super
end

Instance Method Details

#authorized(password) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/redis/bin.rb', line 29

def authorized password
  return true if @authorized
  return false unless @config[:requirepass] == password
  extend Server
  extend Keys
  extend Strings
  extend Lists
  extend Sets
  extend ZSets
  extend Hashes
  extend PubSub
  @authorized = true
end

#post_initObject



24
25
26
27
# File 'lib/redis/bin.rb', line 24

def post_init
  authorized nil
  set_comm_inactivity_timeout @config[:timeout]
end