tdl-client-ruby 0.19.2 → 0.19.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tdl/client.rb +0 -1
- data/lib/tdl/previous_version.rb +1 -1
- data/lib/tdl/thread_timer.rb +3 -3
- data/lib/tdl/transport/remote_broker.rb +9 -6
- 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: bfea2b9c8522c632c1575cb265fa63878c43bc58
|
4
|
+
data.tar.gz: dadbb03629370a64ba8a4a4276f89e02226989ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeb4e17b7745cacf524813ffb60764420371da73130b379571bc21e4883392694a3bd9a00494207e9323aadde3b2775c9a8bc54faa281d1a7dea61b9b19ed609
|
7
|
+
data.tar.gz: aa0d593c0048d922993c6296ca1c7c306a8d3eb3bf827ca0c4201414cb290913e26c389501bbd64093e945166368ff973f1701840adb97c83ce653cec0a9ddd0
|
data/lib/tdl/client.rb
CHANGED
data/lib/tdl/previous_version.rb
CHANGED
data/lib/tdl/thread_timer.rb
CHANGED
@@ -6,15 +6,15 @@ class ThreadTimer
|
|
6
6
|
@timer_thread = nil
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
9
|
+
def start
|
10
10
|
@continue = true
|
11
11
|
@timer_thread = Thread.new { start_timeout }
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
@continue = false
|
14
|
+
def stop
|
16
15
|
@timer_thread.terminate unless @timer_thread.nil?
|
17
16
|
@timer_thread = nil
|
17
|
+
@continue = false
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
@@ -5,31 +5,34 @@ module TDL
|
|
5
5
|
def initialize(hostname, port, unique_id, request_timeout_millis)
|
6
6
|
@stomp_client = Stomp::Client.new('', '', hostname, port)
|
7
7
|
@unique_id = unique_id
|
8
|
+
@request_queue = "/queue/#{@unique_id}.req"
|
9
|
+
@response_queue = "/queue/#{@unique_id}.resp"
|
8
10
|
@serialization_provider = JSONRPCSerializationProvider.new
|
9
|
-
@
|
11
|
+
@timer = ThreadTimer.new(request_timeout_millis, lambda = ->() { close unless closed? })
|
12
|
+
@timer.start
|
10
13
|
end
|
11
14
|
|
12
15
|
def subscribe(handling_strategy)
|
13
|
-
@stomp_client.subscribe(
|
14
|
-
@
|
16
|
+
@stomp_client.subscribe(@request_queue, {:ack => 'client-individual', 'activemq.prefetchSize' => 1}) do |msg|
|
17
|
+
@timer.stop
|
15
18
|
request = @serialization_provider.deserialize(msg)
|
16
19
|
handling_strategy.process_next_request_from(self, request)
|
17
|
-
@
|
20
|
+
@timer.start
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
21
24
|
def respond_to(request, response)
|
22
25
|
serialized_response = @serialization_provider.serialize(response)
|
23
|
-
@stomp_client.publish(
|
26
|
+
@stomp_client.publish(@response_queue, serialized_response)
|
24
27
|
@stomp_client.acknowledge(request.original_message)
|
25
28
|
end
|
26
29
|
|
27
30
|
def join
|
28
|
-
@timer_thread.start_timer
|
29
31
|
@stomp_client.join
|
30
32
|
end
|
31
33
|
|
32
34
|
def close
|
35
|
+
@stomp_client.unsubscribe(@request_queue)
|
33
36
|
@stomp_client.close
|
34
37
|
end
|
35
38
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdl-client-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.19.
|
4
|
+
version: 0.19.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Ghionoiu
|
@@ -221,7 +221,7 @@ homepage: https://github.com/julianghionoiu/tdl-client-ruby
|
|
221
221
|
licenses:
|
222
222
|
- GPL-3.0
|
223
223
|
metadata:
|
224
|
-
previous_version: 0.19.
|
224
|
+
previous_version: 0.19.2
|
225
225
|
post_install_message:
|
226
226
|
rdoc_options: []
|
227
227
|
require_paths:
|