rxio 1.2.7 → 1.2.8

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: 06b0002ad0e5d43f0609069c83f4e71fa3d58e57
4
- data.tar.gz: 422d86c9ded02217e55b7da9e05f269bba1efdf9
3
+ metadata.gz: 7b0f3e4e386d37a6793177b9fb036fd8ea050cef
4
+ data.tar.gz: e3f0e38d21dfcc1e03f82733e657e1eb9b05fa33
5
5
  SHA512:
6
- metadata.gz: '03791359b63fe1805342643004d8857f1e84c719a1d3bb011d4978f571e182199dcae2151eae0a11349c418dc7f1a5283c5ed099fd6cc767f1546aa1c6cb9a3c'
7
- data.tar.gz: 3363cb58b5d18c76867ab052e91d3c4b8e35adc22581fe57c424da765dd7d2b698b36747882d182b65d803166edb4dc69f79af67ee5098b10b109a5803f4e5e7
6
+ metadata.gz: 49175e7552f3247827df78135c4e29bb357dd3fc683f5f95423fd4b615dcb39072829f8cbc5ec03a0f2a6947d586415d69b25437a48d85d823e16fffee63b763
7
+ data.tar.gz: 0ee82baa23500726755e105fed8cfe1db630e12e8e373e77f5a68ecc566dd84853f5f1f889672adb8e9ad1b8e95ea71c661316dfb6e47a659630c7f91e774518
data/README.md CHANGED
@@ -157,6 +157,31 @@ module FooHandler
157
157
  end
158
158
  ```
159
159
 
160
+ ### Switching targets (for Client)
161
+
162
+ When working with a service client, sometimes it may be required to disconnect the client and re-connect it to another server.
163
+
164
+ This can be done using the _set_target_ method, which updates the *addr* and *port* attributes of the client.
165
+
166
+ ```ruby
167
+ # Use foo.example.com:4432 as target for next connection
168
+ client.set_target 'foo.example.com', 4432
169
+ ```
170
+
171
+ The next time a connection is established, it will use the new target.
172
+
173
+ When running in the background (through Runify), this can be immediately forced by restarting the client.
174
+
175
+ ```ruby
176
+ # Use foo.example.com:4432 as target for next connection
177
+ client.set_target 'foo.example.com', 4432
178
+
179
+ # Immediately enforce the use of the new target
180
+ client.restart
181
+ ```
182
+
183
+ When running in single-thread mode (through the client's 'run' method), this can be immediately forced by stopping the client and then restarting it.
184
+
160
185
  ### Provided Filters
161
186
 
162
187
  Some generic filters are provided as part of the *RxIO::IOFilters* module.
data/lib/rxio/client.rb CHANGED
@@ -63,6 +63,15 @@ module RxIO
63
63
  }
64
64
  end
65
65
 
66
+ # Set Target:
67
+ # Updates the target address & port, to be used next time a connection is established.
68
+ # @param [String] addr
69
+ # @param [Fixnum] port
70
+ def set_target addr, port
71
+ @addr = addr
72
+ @port = port
73
+ end
74
+
66
75
  # Send Message:
67
76
  # Enqueues a Message to be sent to the server.
68
77
  # @param [String] msg
data/lib/rxio/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  module RxIO
6
6
 
7
7
  # Version
8
- VERSION = '1.2.7'
8
+ VERSION = '1.2.8'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rxio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-15 00:00:00.000000000 Z
11
+ date: 2017-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.6.8
126
+ rubygems_version: 2.5.1
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Reactive Sockets for Ruby