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 +4 -4
- data/README.md +4 -2
- data/lib/twingly/amqp/pinger.rb +3 -1
- data/lib/twingly/amqp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb13b028753ea6a081b6612e3789ce6cf0e11616
|
|
4
|
+
data.tar.gz: d608291e7ff250cb09bb8c2da98b54d1d59b6d9f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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:
|
|
83
|
-
|
|
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
|
data/lib/twingly/amqp/pinger.rb
CHANGED
|
@@ -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
|
|
data/lib/twingly/amqp/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bunny
|