boardintel_frenzy_bunnies 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63df074580a0e202dd4ab7dac29bedc1345e1d66
4
- data.tar.gz: 2ca899cd304e0655d69aa260b8b431c98c2035b8
3
+ metadata.gz: dfbd7c57015e5b1b9a4cbd6c0e98a19f14aafd42
4
+ data.tar.gz: 6389c4b8d9e68bb9a7068bb5adad9661745c5282
5
5
  SHA512:
6
- metadata.gz: 481d9cdd9d2e6aa25f5bf1383dd9fa7575211af765ff9a373dda2f632392ce8759d05b3bddedf6805fcd37dedb659fb6ec9d32390a81c38bade0c1f9107da341
7
- data.tar.gz: 026f32086e655fa3d41807e7548094b0aca9748e924a87875ec7afde9d6d7d5f258ed532f6ef459ef1e2f30b259a9f4abb469e612334a69618101fc71677627b
6
+ metadata.gz: ef6a99f86d141881718f486eea41bd9f5825ea966211061193294f267e927f0c08a1621b2e0f8e4e9fd9a1b8b80ba1085cc80764c64b36754dbc137895eddbdc
7
+ data.tar.gz: ff754507a6f9045544591cc03abaad925c68b8e521dcc85b7465d149224cc47a751d61da21d820dc2bed9248f58da2c56326703a754a0b9527cceb5cf54c171c
@@ -1,3 +1,3 @@
1
1
  module FrenzyBunnies
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -42,33 +42,34 @@ module FrenzyBunnies::Worker
42
42
 
43
43
  q = context.queue_factory.build_queue(@queue_name, @queue_opts)
44
44
 
45
- say "#{@queue_opts[:threads] ? "#{@queue_opts[:threads]} threads " : ''}with #{@queue_opts[:prefetch]} prefetch on <#{@queue_name}>."
46
-
47
- q.subscribe(:ack => true, :blocking => false, :executor => @thread_pool) do |headers, msg|
48
- worker = new
49
- handler = @queue_opts[:handler].new(headers.channel, q, @logger, { queue_options: @queue_opts })
50
- begin
51
- Timeout::timeout(@queue_opts[:timeout_job_after]) do
52
- if worker.work(msg)
53
- handler.acknowledge(headers, msg)
54
- incr! :passed
55
- else
56
- handler.reject(headers, msg)
57
- incr! :failed
58
- error "REJECTED", msg
45
+ say "#{@queue_opts[:threads]} with #{@queue_opts[:prefetch]} prefetch on <#{@queue_name}>."
46
+
47
+ q.subscribe(:ack => true, :blocking => false) do |headers, msg|
48
+ @thread_pool.submit do
49
+ worker = new
50
+ handler = @queue_opts[:handler].new(headers.channel, q, @logger, { queue_options: @queue_opts })
51
+ begin
52
+ Timeout::timeout(@queue_opts[:timeout_job_after]) do
53
+ if worker.work(msg)
54
+ handler.acknowledge(headers, msg)
55
+ incr! :passed
56
+ else
57
+ handler.reject(headers, msg)
58
+ incr! :failed
59
+ error "REJECTED", msg
60
+ end
59
61
  end
62
+ rescue Timeout::Error
63
+ handler.timeout(headers, msg)
64
+ incr! :failed
65
+ error "TIMEOUT #{@queue_opts[:timeout_job_after]}s", msg
66
+ rescue
67
+ handler.reject(headers, msg)
68
+ incr! :failed
69
+ error "ERROR #{$!}", msg
60
70
  end
61
- rescue Timeout::Error
62
- handler.timeout(headers, msg)
63
- incr! :failed
64
- error "TIMEOUT #{@queue_opts[:timeout_job_after]}s", msg
65
- rescue
66
- handler.reject(headers, msg)
67
- incr! :failed
68
- error "ERROR #{$!}", msg
69
71
  end
70
72
  end
71
-
72
73
  say "workers up."
73
74
  end
74
75
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boardintel_frenzy_bunnies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dotan Nahum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-08 00:00:00.000000000 Z
11
+ date: 2018-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement