twingly-amqp 4.0.0 → 4.1.0

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: 6219ee67359e165f827b9c944028390b4506a0e6
4
- data.tar.gz: 83fedd73df0b32f0d9929001ca2bc431ab2149c3
3
+ metadata.gz: bb13b028753ea6a081b6612e3789ce6cf0e11616
4
+ data.tar.gz: d608291e7ff250cb09bb8c2da98b54d1d59b6d9f
5
5
  SHA512:
6
- metadata.gz: 2e923cc07303a09621892d0405093a247c4828c02060c585fa5a011b70321b14cd3adfa12560338d67c68d773cb214d2e2f876b9c0117fceb00a4d24979a76ef
7
- data.tar.gz: ad3c376131f4309417d7d0292da8ca35347478469d390fc543ecbb72abcab06d78eddab1cc8a90d2daa6a0fa4dc1bbc16c3acca02faec34689fc991ad833c039
6
+ metadata.gz: 816f2a4b903a88525fc607436dd90e0f7783ed613d6d555fc76f90028004d65d0ed32c136cf31023f4189fed8f4a35a397c98b5df0ffb5337da6247dcb206d99
7
+ data.tar.gz: 1b9c9972ebbdf224e8a77a3a4bfb3495344f0005fd100f60ef1490d66adcbe7dfc7b1601055256fb4ddbb9dcb442ea1b8bf3a7932f8fb88bb0b7ba150957540e
data/README.md CHANGED
@@ -79,8 +79,10 @@ end
79
79
 
80
80
  ```ruby
81
81
  pinger = Twingly::AMQP::Pinger.new(
82
- queue_name: "provider-ping",
83
- url_cache: url_cache, # Optional, see below
82
+ queue_name: "provider-ping",
83
+ ping_expiration: 2_000, # Optional, ms, discard the ping if it's still on
84
+ # the queue after this amount of milliseconds
85
+ url_cache: url_cache, # Optional, see below
84
86
  )
85
87
 
86
88
  # Optional, options can also be given to #ping
@@ -5,13 +5,14 @@ require "json"
5
5
  module Twingly
6
6
  module AMQP
7
7
  class Pinger
8
- def initialize(queue_name:, url_cache: NullCache, connection: nil)
8
+ def initialize(queue_name:, ping_expiration: nil, url_cache: NullCache, connection: nil)
9
9
  @queue_name = queue_name
10
10
  @url_cache = url_cache
11
11
 
12
12
  connection ||= Connection.instance
13
13
  @channel = connection.create_channel
14
14
 
15
+ @ping_expiration = ping_expiration
15
16
  @default_ping_options = PingOptions.new
16
17
  end
17
18
 
@@ -47,6 +48,7 @@ module Twingly
47
48
  key: @queue_name,
48
49
  persistent: true,
49
50
  content_type: "application/json",
51
+ expiration: @ping_expiration,
50
52
  }
51
53
  end
52
54
 
@@ -1,5 +1,5 @@
1
1
  module Twingly
2
2
  module Amqp
3
- VERSION = "4.0.0"
3
+ VERSION = "4.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twingly-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twingly AB
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2015-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny