Class: RedisRpc::Server

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

Instance Method Summary collapse

Constructor Details

#initialize(redis_server, message_queue, local_object, timeout = nil, verbose: false) ⇒ Server

Returns a new instance of Server.



101
102
103
104
105
106
107
# File 'lib/redis-rpc.rb', line 101

def initialize( redis_server, message_queue, local_object, timeout=nil, verbose: false)
  @redis_server = redis_server
  @message_queue = message_queue
  @local_object = local_object
  @timeout = timeout
  @verbose = verbose
end

Instance Method Details

#flush_queue!Object



118
119
120
# File 'lib/redis-rpc.rb', line 118

def flush_queue!
  @redis_server.del @message_queue
end

#runObject



109
110
111
# File 'lib/redis-rpc.rb', line 109

def run
  loop{ run_one }
end

#run!Object



113
114
115
116
# File 'lib/redis-rpc.rb', line 113

def run!
  flush_queue!
  run
end