pushyd 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54a6cf7226a4a95124ba16fa0d27bdad2cf621ef
4
- data.tar.gz: c9cf7519bd72e2063e1dc8013d3e26ca892e8786
3
+ metadata.gz: aa2f4f22cf8e3d98832400f34893f1128365332f
4
+ data.tar.gz: e8307c72a56774a3eb6f8b33d888a88fc1ffaeda
5
5
  SHA512:
6
- metadata.gz: 4b3be1820dc1580dbadbada3b8cdcaeb0aa07a0329c06fd958ed752bd47c4d52d685cfc2510e4a3c7a2e5796b7448c85c0884c2418bac27fabe46562848a23a5
7
- data.tar.gz: 3d1474d0b4ffa11cdc63bb00abd739bf9d6c61de2efc5797c435dc6e961def696f302bf3fbf350db9d606e1e5825967228b4787091f45a9299b568bd6d3a0519
6
+ metadata.gz: 82235ff0e466f37ae7bb1b200e0e49419e2be4116d84616cbf9473d60919640adbcc45855255aaf36c19a8ddc74c6a88e96a064d69ed307d25290a888c77ebc0
7
+ data.tar.gz: 3d43ed96eedd95cf24e3471cd4f5975e6a550559d4dd777334ba398c5c1b515dc38718a49f6524e508631c85322dcbad3f6ce421efd70744c8b72bbff5e19b2e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pushyd (0.8.1)
4
+ pushyd (0.8.2)
5
5
  api-auth
6
6
  bunny (~> 2.3)
7
7
  chamber (~> 2.9)
@@ -54,7 +54,7 @@ GEM
54
54
  rspec-core (~> 3.5.0)
55
55
  rspec-expectations (~> 3.5.0)
56
56
  rspec-mocks (~> 3.5.0)
57
- rspec-core (3.5.0)
57
+ rspec-core (3.5.1)
58
58
  rspec-support (~> 3.5.0)
59
59
  rspec-expectations (3.5.0)
60
60
  diff-lcs (>= 1.2.0, < 2.0)
@@ -63,7 +63,7 @@ GEM
63
63
  diff-lcs (>= 1.2.0, < 2.0)
64
64
  rspec-support (~> 3.5.0)
65
65
  rspec-support (3.5.0)
66
- rubocop (0.41.1)
66
+ rubocop (0.41.2)
67
67
  parser (>= 2.3.1.1, < 3.0)
68
68
  powerpack (~> 0.1)
69
69
  rainbow (>= 1.99.1, < 3.0)
@@ -20,4 +20,7 @@ LOG_MESSAGE_HASH = "%s %-20s %s\n"
20
20
  # Constants: logger app-specific prefix
21
21
  LOG_PREFIX_FORMAT = nil
22
22
 
23
-
23
+ # Constants: AMQP protocol
24
+ AMQP_HEARTBEAT_INTERVAL = 30
25
+ AMQP_RECOVERY_INTERVAL = 5
26
+ AMQP_PREFETCH = 1
@@ -75,12 +75,18 @@ module PushyDaemon
75
75
  def connect_channel busconf
76
76
  fail PushyDaemon::EndpointConnexionContext, "invalid bus host/port" unless busconf
77
77
  info "connecting to #{busconf}"
78
- conn = Bunny.new busconf.to_s
79
- #, logger: @logger, heartbeat: :server
78
+ conn = Bunny.new busconf.to_s,
79
+ logger: @logger,
80
+ # heartbeat: :server,
81
+ automatically_recover: true,
82
+ network_recovery_interval: AMQP_RECOVERY_INTERVAL,
83
+ heartbeat_interval: AMQP_HEARTBEAT_INTERVAL
80
84
  conn.start
81
85
 
82
- # Create channel
86
+
87
+ # Create channel, prefetch only one message at a time
83
88
  channel = conn.create_channel
89
+ channel.prefetch(AMQP_PREFETCH)
84
90
 
85
91
  rescue Bunny::TCPConnectionFailedForAllHosts, Bunny::AuthenticationFailureError, AMQ::Protocol::EmptyResponseError => e
86
92
  fail PushyDaemon::EndpointConnectionError, "error connecting (#{e.class})"
data/pushyd.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  # Project version
4
- spec.version = "0.8.1"
4
+ spec.version = "0.8.2"
5
5
 
6
6
  # Project description
7
7
  spec.name = "pushyd"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushyd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-06 00:00:00.000000000 Z
11
+ date: 2016-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler