tdl-client-ruby 0.10.1 → 0.10.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 +4 -4
- data/.DS_Store +0 -0
- data/README.md +13 -1
- data/lib/tdl/client.rb +3 -3
- data/lib/tdl/previous_version.rb +1 -1
- data/lib/tdl/transport/remote_broker.rb +4 -4
- data/tdl-client-ruby.iml +3 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b93a578c88c3c616ad330a44eafeb7411d43aa62
|
4
|
+
data.tar.gz: 12acc2e816d8227cf5e9cc7b2a8ab3487469f555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 474085531afb1e04f7e634cf7561a8d0618bce4d9a9045fcc73f854b33abd3100ff742a4dff51f85970e306e3a6a345e25309f232e741c08bdab8b690bc96712
|
7
|
+
data.tar.gz: 2bfcf75a710bbfe87616702ea3f7e538116411243ae54899fc730acaa1216eeadfef5b888a26d442386f104252edc2ae005e9b8674edc9b64cd3d2cda2cf6d0e
|
data/.DS_Store
ADDED
Binary file
|
data/README.md
CHANGED
@@ -4,7 +4,19 @@
|
|
4
4
|
[](https://coveralls.io/github/julianghionoiu/tdl-client-ruby?branch=master)
|
5
5
|
|
6
6
|
# tdl-client-ruby
|
7
|
-
|
7
|
+
|
8
|
+
```
|
9
|
+
# Install RVM
|
10
|
+
curl -sSL https://get.rvm.io | bash -s stable
|
11
|
+
echo 'source /Users/julianghionoiu/.rvm/scripts/rvm' >> .bash_profile
|
12
|
+
|
13
|
+
# Install ruby
|
14
|
+
rvm install ruby-2.2.2
|
15
|
+
rvm use ruby-2.2.2
|
16
|
+
|
17
|
+
# Install bundler
|
18
|
+
gem install bundler
|
19
|
+
```
|
8
20
|
|
9
21
|
# Installing
|
10
22
|
|
data/lib/tdl/client.rb
CHANGED
@@ -10,17 +10,17 @@ module TDL
|
|
10
10
|
|
11
11
|
class Client
|
12
12
|
|
13
|
-
def initialize(hostname:, port: 61613,
|
13
|
+
def initialize(hostname:, port: 61613, unique_id:)
|
14
14
|
@hostname = hostname
|
15
15
|
@port = port
|
16
|
-
@
|
16
|
+
@unique_id = unique_id
|
17
17
|
@logger = Logging.logger[self]
|
18
18
|
end
|
19
19
|
|
20
20
|
def go_live_with(processing_rules)
|
21
21
|
begin
|
22
22
|
@logger.info 'Starting client.'
|
23
|
-
remote_broker = RemoteBroker.new(@hostname, @port, @
|
23
|
+
remote_broker = RemoteBroker.new(@hostname, @port, @unique_id)
|
24
24
|
remote_broker.subscribe(ApplyProcessingRules.new(processing_rules))
|
25
25
|
|
26
26
|
#DEBT: We should have no timeout here. We could put a special message in the queue
|
data/lib/tdl/previous_version.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module TDL
|
2
2
|
class RemoteBroker
|
3
|
-
def initialize(hostname, port,
|
3
|
+
def initialize(hostname, port, unique_id)
|
4
4
|
@stomp_client = Stomp::Client.new('', '', hostname, port)
|
5
|
-
@
|
5
|
+
@unique_id = unique_id
|
6
6
|
@serialization_provider = JSONRPCSerializationProvider.new
|
7
7
|
end
|
8
8
|
|
9
9
|
def subscribe(handling_strategy)
|
10
|
-
@stomp_client.subscribe("/queue/#{@
|
10
|
+
@stomp_client.subscribe("/queue/#{@unique_id}.req", {:ack => 'client', 'activemq.prefetchSize' => 1}) do |msg|
|
11
11
|
request = @serialization_provider.deserialize(msg)
|
12
12
|
handling_strategy.process_next_request_from(self, request)
|
13
13
|
end
|
@@ -15,7 +15,7 @@ module TDL
|
|
15
15
|
|
16
16
|
def respond_to(request, response)
|
17
17
|
serialized_response = @serialization_provider.serialize(response)
|
18
|
-
@stomp_client.publish("/queue/#{@
|
18
|
+
@stomp_client.publish("/queue/#{@unique_id}.resp", serialized_response)
|
19
19
|
@stomp_client.acknowledge(request.original_message)
|
20
20
|
end
|
21
21
|
|
data/tdl-client-ruby.iml
CHANGED
@@ -15,12 +15,14 @@
|
|
15
15
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
16
16
|
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
|
17
17
|
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
18
|
+
<excludeFolder url="file://$MODULE_DIR$/broker/.cache" />
|
19
|
+
<excludeFolder url="file://$MODULE_DIR$/coverage" />
|
18
20
|
</content>
|
19
21
|
<orderEntry type="jdk" jdkName="rbenv: 2.2.2" jdkType="RUBY_SDK" />
|
20
22
|
<orderEntry type="sourceFolder" forTests="false" />
|
21
23
|
<orderEntry type="library" scope="PROVIDED" name="ansi (v1.5.0, rbenv: 2.2.2) [gem]" level="application" />
|
22
24
|
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.2, rbenv: 2.2.2) [gem]" level="application" />
|
23
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.12.5, rbenv: 2.2.2) [gem]" level="application" />
|
24
26
|
<orderEntry type="library" scope="PROVIDED" name="coveralls (v0.8.2, rbenv: 2.2.2) [gem]" level="application" />
|
25
27
|
<orderEntry type="library" scope="PROVIDED" name="cucumber (v2.0.2, rbenv: 2.2.2) [gem]" level="application" />
|
26
28
|
<orderEntry type="library" scope="PROVIDED" name="cucumber-core (v1.2.0, rbenv: 2.2.2) [gem]" level="application" />
|
@@ -40,7 +42,6 @@
|
|
40
42
|
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.11.2, rbenv: 2.2.2) [gem]" level="application" />
|
41
43
|
<orderEntry type="library" scope="PROVIDED" name="multi_test (v0.1.2, rbenv: 2.2.2) [gem]" level="application" />
|
42
44
|
<orderEntry type="library" scope="PROVIDED" name="netrc (v0.10.3, rbenv: 2.2.2) [gem]" level="application" />
|
43
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v10.4.2, rbenv: 2.2.2) [gem]" level="application" />
|
44
45
|
<orderEntry type="library" scope="PROVIDED" name="rest-client (v1.8.0, rbenv: 2.2.2) [gem]" level="application" />
|
45
46
|
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.7.5, rbenv: 2.2.2) [gem]" level="application" />
|
46
47
|
<orderEntry type="library" scope="PROVIDED" name="simplecov (v0.10.0, rbenv: 2.2.2) [gem]" level="application" />
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdl-client-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Ghionoiu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stomp
|
@@ -189,6 +189,7 @@ executables: []
|
|
189
189
|
extensions: []
|
190
190
|
extra_rdoc_files: []
|
191
191
|
files:
|
192
|
+
- ".DS_Store"
|
192
193
|
- ".gitignore"
|
193
194
|
- ".gitmodules"
|
194
195
|
- CODE_OF_CONDUCT.md
|
@@ -220,7 +221,7 @@ homepage: https://github.com/julianghionoiu/tdl-client-ruby
|
|
220
221
|
licenses:
|
221
222
|
- GPL-3.0
|
222
223
|
metadata:
|
223
|
-
previous_version: 0.
|
224
|
+
previous_version: 0.10.1
|
224
225
|
post_install_message:
|
225
226
|
rdoc_options: []
|
226
227
|
require_paths:
|