queue_worker 2.1.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/queue_worker.rb +3 -3
- data/lib/queue_worker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 832a271866cf5cb1b49b32c377d31183bd45ff22
|
4
|
+
data.tar.gz: b393d4783b891d38f24ae47c7d7dc2c815e355ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb64837931c17952508df5300413e3f9f820b02368f008f33013969d1d0da1b9b3c0c3886e72cba1239b185bfca5985d31b28716da75d672a2565bc1fab2d4e0
|
7
|
+
data.tar.gz: e616c462dc3b508940a771130e005ace7f2b2288d2a9dcfaa418bfe2b003a0b99acc2d35811bfeae1b669c254640a86c22cff4d26e494acf14a153b684ea8a95
|
data/lib/queue_worker.rb
CHANGED
@@ -23,7 +23,7 @@ class QueueWorker
|
|
23
23
|
|
24
24
|
# @param [String] queue_name the queue to pub/sub
|
25
25
|
# @param [#info, #warn, #error] log
|
26
|
-
# @param [Proc] block to
|
26
|
+
# @param [Proc] block to process a message received by +subscribe+
|
27
27
|
def initialize(queue_name = nil, log = nil, &block)
|
28
28
|
@queue = queue_name
|
29
29
|
@log = log
|
@@ -119,13 +119,13 @@ class QueueWorker
|
|
119
119
|
# @param [Stomp::Message] message is the container object Stomp gives us for what is really a "frame" or package from the queue
|
120
120
|
def call(message)
|
121
121
|
if message.command == 'MESSAGE'
|
122
|
-
handler.call(JSON.parse(message.body, symbolize_names: true)
|
122
|
+
handler.call(JSON.parse(message.body, symbolize_names: true))
|
123
123
|
end
|
124
124
|
rescue => e
|
125
125
|
log.error(e.message) { "\n#{e.backtrace.inspect}" }
|
126
126
|
ensure
|
127
127
|
ack(message)
|
128
|
-
log.info('Processed') {
|
128
|
+
log.info('Processed') { %(#{message.headers['message-id']} from "#{message.headers['destination']}") }
|
129
129
|
end
|
130
130
|
|
131
131
|
def client
|
data/lib/queue_worker/version.rb
CHANGED