We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db237ac commit 4f55a4fCopy full SHA for 4f55a4f
ruby/receive.rb
@@ -0,0 +1,21 @@
1
+#!/usr/bin/env ruby
2
+# encoding: utf-8
3
+
4
+require "amqp"
5
6
+AMQP.start(:host => "localhost") do |connection|
7
+ channel = AMQP::Channel.new(connection)
8
+ queue = channel.queue("hello")
9
10
+ Signal.trap("INT") do
11
+ connection.close do
12
+ EM.stop { exit }
13
+ end
14
15
16
+ puts " [*] Waiting for messages. To exit press CTRL+C"
17
18
+ queue.subscribe do |body|
19
+ puts " [x] Received #{body}"
20
21
+end
0 commit comments