Class: Zack::Server
Overview
Server side for RPC calls.
Instance Attribute Summary collapse
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Attributes inherited from Target
Instance Method Summary collapse
-
#handle_request ⇒ Object
Handles exactly one request.
-
#initialize(tube_name, opts = {}) ⇒ Server
constructor
A new instance of Server.
Methods inherited from Target
Constructor Details
#initialize(tube_name, opts = {}) ⇒ Server
Returns a new instance of Server.
8 9 10 11 12 13 |
# File 'lib/zack/server.rb', line 8 def initialize(tube_name, opts={}) super channel = Cod.beanstalk(server, tube_name) @service = Cod::Service.new(channel) end |
Instance Attribute Details
#service ⇒ Object (readonly)
Returns the value of attribute service.
6 7 8 |
# File 'lib/zack/server.rb', line 6 def service @service end |
Instance Method Details
#handle_request ⇒ Object
Handles exactly one request.
17 18 19 20 21 |
# File 'lib/zack/server.rb', line 17 def handle_request service.one { |(sym, args)| process_request(sym, args) } end |