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.



91
92
93
94
95
96
97
# File 'lib/redis-rpc.rb', line 91

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



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

def flush_queue!
  @redis_server.del @message_queue
end

#runObject



99
100
101
# File 'lib/redis-rpc.rb', line 99

def run
  loop{ run_one }
end

#run!Object



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

def run!
  flush_queue!
  run
end