Class: Miu::RPC::Server
- Inherits:
-
Object
- Object
- Miu::RPC::Server
- Includes:
- Celluloid::ZMQ, Helpers
- Defined in:
- lib/miu/rpc/server.rb
Defined Under Namespace
Classes: Evaluator
Instance Method Summary collapse
- #close ⇒ Object
- #handle_message(parts) ⇒ Object
-
#initialize(address, handler) ⇒ Server
constructor
A new instance of Server.
- #run ⇒ Object
Methods included from Helpers
Constructor Details
Instance Method Details
#close ⇒ Object
25 26 27 28 |
# File 'lib/miu/rpc/server.rb', line 25 def close @socket.close terminate end |
#handle_message(parts) ⇒ Object
37 38 39 40 41 |
# File 'lib/miu/rpc/server.rb', line 37 def (parts) id, request = parts response = @evaluator.process_request request @socket.write id, response end |
#run ⇒ Object
30 31 32 33 34 35 |
# File 'lib/miu/rpc/server.rb', line 30 def run loop do parts = read_parts @socket async. parts end end |