Class: ProcessCommand::Socket::Receiver
Constant Summary
collapse
- RECEIVER_QUEUE =
Queue.new
Class Method Summary
collapse
add_command_block, init, run_command_block
Class Method Details
.init_handler ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/process_command/socket/receiver.rb', line 18
def init_handler
while client = @server.accept
Thread.new do
command = client.read
run_command_block command
end
end
end
|
.init_listener ⇒ Object
12
13
14
15
16
|
# File 'lib/process_command/socket/receiver.rb', line 12
def init_listener
path = Setting.socket_path Process.pid
File.delete path if File.exists? path
@server = UNIXServer.new path
end
|