freddy 0.3.0 → 0.3.1
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/freddy.gemspec +1 -1
- data/lib/freddy.rb +6 -2
- data/lib/freddy/request.rb +6 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e21020f1717f322384deb6ab9ce33231c59a7d82
|
4
|
+
data.tar.gz: 6efdccf186349f3f874dee8889bda4a4a269b40b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b69c2cb81573afc359da3aaa8e1387d479224716e3e49d75ea09781e85895d89891f91617873cd8a2c01dafdaaa958d4241b62d2fc50655e8f104933efb33f92
|
7
|
+
data.tar.gz: 813043fcd1e6d2adfdd16c5c379f9d8ba7b9df8d82db1365547760f8a827dfac4e970bbd850918e85cc401c4daf43f873f1fbb7a4a8974e5dae05ae8841ba16e
|
data/freddy.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "freddy"
|
7
|
-
spec.version = '0.3.
|
7
|
+
spec.version = '0.3.1'
|
8
8
|
spec.authors = ["Urmas Talimaa"]
|
9
9
|
spec.email = ["urmas.talimaa@gmail.com"]
|
10
10
|
spec.description = %q{Messaging API}
|
data/lib/freddy.rb
CHANGED
@@ -71,14 +71,18 @@ class Freddy
|
|
71
71
|
@consumer.tap_into pattern, &callback
|
72
72
|
end
|
73
73
|
|
74
|
-
def deliver(destination, payload,
|
74
|
+
def deliver(destination, payload, options = {})
|
75
|
+
timeout = options.fetch(:timeout, 0)
|
75
76
|
opts = {}
|
76
77
|
opts[:expiration] = (timeout * 1000).to_i if timeout > 0
|
77
78
|
|
78
79
|
@producer.produce destination, payload, opts
|
79
80
|
end
|
80
81
|
|
81
|
-
def deliver_with_response(destination, payload,
|
82
|
+
def deliver_with_response(destination, payload, options = {})
|
83
|
+
timeout = options.fetch(:timeout, 3)
|
84
|
+
delete_on_timeout = options.fetch(:delete_on_timeout, true)
|
85
|
+
|
82
86
|
@request.sync_request destination, payload, {
|
83
87
|
timeout: timeout, delete_on_timeout: delete_on_timeout
|
84
88
|
}
|
data/lib/freddy/request.rb
CHANGED
@@ -37,7 +37,12 @@ class Freddy
|
|
37
37
|
container.wait_for_response(timeout_seconds + 0.1)
|
38
38
|
end
|
39
39
|
|
40
|
-
def async_request(destination, payload,
|
40
|
+
def async_request(destination, payload, options, &block)
|
41
|
+
timeout = options.fetch(:timeout)
|
42
|
+
delete_on_timeout = options.fetch(:delete_on_timeout)
|
43
|
+
options.delete(:timeout)
|
44
|
+
options.delete(:delete_on_timeout)
|
45
|
+
|
41
46
|
listen_for_responses unless @listening_for_responses
|
42
47
|
|
43
48
|
correlation_id = SecureRandom.uuid
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Urmas Talimaa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
138
|
rubyforge_project:
|
139
|
-
rubygems_version: 2.
|
139
|
+
rubygems_version: 2.4.2
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: API for inter-application messaging supporting acknowledgements and request-response
|