Class: Droonga::JobReceiver
- Inherits:
-
Object
- Object
- Droonga::JobReceiver
- Includes:
- Loggable
- Defined in:
- lib/droonga/job_receiver.rb
Instance Method Summary collapse
-
#initialize(loop, socket_path, &callback) ⇒ JobReceiver
constructor
A new instance of JobReceiver.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(loop, socket_path, &callback) ⇒ JobReceiver
Returns a new instance of JobReceiver.
25 26 27 28 29 |
# File 'lib/droonga/job_receiver.rb', line 25 def initialize(loop, socket_path, &callback) @loop = loop @socket_path = socket_path @callback = callback end |
Instance Method Details
#shutdown ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/droonga/job_receiver.rb', line 42 def shutdown logger.trace("shutdown: start") @receiver.close logger.trace("shutdown: socket watcher attached", :watcher => @receiver) logger.trace("shutdown: done") end |
#start ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/droonga/job_receiver.rb', line 31 def start logger.trace("start: start") @receiver = Coolio::UNIXSocket.connect(@socket_path) setup_receive_handler(@receiver) @loop.attach(@receiver) logger.trace("start: socket watcher attached", :watcher => @receiver, :socket_path => @socket_path) logger.trace("start: done") end |