Skip to content

Commit b0a44e3

Browse files
committed
Proper SIGINT handling from ruby rpc_server
1 parent e4b167c commit b0a44e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ruby/rpc_server.rb

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ def fib(n)
1212
channel = AMQP::Channel.new(connection)
1313
queue = channel.queue("rpc_queue")
1414

15+
Signal.trap("INT") do
16+
connection.close do
17+
EM.stop { exit }
18+
end
19+
end
20+
1521
channel.prefetch(1)
1622

1723
queue.subscribe(:ack => true) do |header, body|

0 commit comments

Comments
 (0)