Class: RedisRpc::Server
- Inherits:
-
Object
- Object
- RedisRpc::Server
- Defined in:
- lib/redis-rpc.rb
Instance Method Summary collapse
- #flush_queue! ⇒ Object
-
#initialize(redis_server, message_queue, local_object, timeout = nil, verbose: false) ⇒ Server
constructor
A new instance of Server.
- #run ⇒ Object
- #run! ⇒ Object
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, , local_object, timeout=nil, verbose: false) @redis_server = redis_server @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 |
#run ⇒ Object
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 |