watership 0.3.3 → 0.3.5

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: 504aad6fe9a8435d3a13768c3f7e424fcd9c4dfc
4
- data.tar.gz: 2bf978476f854e61c0daf9d4139b5a07fa7adf3b
3
+ metadata.gz: 0e68c5252d98d3bf463a4bd6796485624d3450c3
4
+ data.tar.gz: 5bb900d6db0d07207b082254b22efc8e29a2f89c
5
5
  SHA512:
6
- metadata.gz: d4a93c65f723351f5ecc18f4c170ed439cf67c43dc00ee09b9b52a546300ebce1022e50ab12dc312762b4a016e5ebcfefdd363b633bb4d330ba12f5aacf9ce98
7
- data.tar.gz: 1e23c9e0fbce128f44b50922563f0c75f1701d715b416be6823d06ce67c988947f227a96ab07c5ef62a91ffe9ae44617d5b0d47fc920615fb90e595557483e6c
6
+ metadata.gz: 6b8462e0e56e79fbd9d343d5dd00b5930768b7cab7a81ea95bd9358136f99584d3e9c00e2d26ef560d119733bb815a2ab52ff43857040badee3875bc1921255d
7
+ data.tar.gz: dce9f301810261e9001e6f25439df6c5bdd26a6c7ce0420d31549a74b85d34e6bf103f716c62b234615fb8a20ae380c020f45363e9beb854188cbadc206d613d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.5 - 2014-06-20
4
+ * Remove dependency on Rails in `Watership::Consumer`.
5
+
6
+ ## 0.3.4 - 2014-06-20
7
+ * Default prefetch to 200.
8
+
3
9
  ## 0.3.3 - 2014-05-23
4
10
  * Fix typo
5
11
 
@@ -5,7 +5,7 @@ module Watership
5
5
  def initialize(consumer, url, channel_options = {}, queue_options = {})
6
6
  @consumer = consumer
7
7
  @url = url
8
- @prefetch = channel_options.delete(:prefetch) || 0
8
+ @prefetch = channel_options.delete(:prefetch) || Integer(ENV.fetch("RABBIT_CONSUMER_PREFETCH", 200))
9
9
  @channel_opts = {durable: true}.merge(channel_options)
10
10
  @queue_opts = {block: true, ack: true}.merge(queue_options)
11
11
  end
@@ -19,28 +19,28 @@ module Watership
19
19
  @consumer.call(JSON.parse(payload))
20
20
  success = true
21
21
  rescue StandardError => exception
22
- Rails.logger.error "Error thrown in subscribe block"
23
- Rails.logger.error exception.message
24
- Rails.logger.error exception.backtrace.join("\n")
25
- Airbrake.notify(exception) if defined? AirBrake
26
- Rails.logger.info "Rejecting in rabbit"
22
+ Watership.logger.error "Error thrown in subscribe block"
23
+ Watership.logger.error exception.message
24
+ Watership.logger.error exception.backtrace.join("\n")
25
+ Watership.notify(exception)
26
+ Watership.logger.info "Rejecting in rabbit"
27
27
  throw(:terminate)
28
28
  rescue Interrupt => exception
29
- Rails.logger.error "Interrupt in subscribe block"
30
- Rails.logger.warn "Stopped gracefully."
29
+ Watership.logger.error "Interrupt in subscribe block"
30
+ Watership.logger.warn "Stopped gracefully."
31
31
  throw(:terminate)
32
32
  ensure
33
33
  if success
34
- Rails.logger.info "Acking message"
34
+ Watership.logger.info "Acking message"
35
35
  channel.acknowledge(delivery_info.delivery_tag, false)
36
36
  else
37
- Rails.logger.info "Rejecting message"
37
+ Watership.logger.info "Rejecting message"
38
38
  channel.reject(delivery_info.delivery_tag, true)
39
39
  end
40
40
  end
41
41
  end
42
42
  ensure
43
- Rails.logger.info "Closing Channel"
43
+ Watership.logger.info "Closing Channel"
44
44
  channel.close
45
45
  end
46
46
  end
@@ -1,3 +1,3 @@
1
1
  module Watership
2
- VERSION = "0.3.3"
2
+ VERSION = '0.3.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watership
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Scofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-22 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler