rxio 1.2.7 → 1.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -0
- data/lib/rxio/client.rb +9 -0
- data/lib/rxio/version.rb +1 -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: 7b0f3e4e386d37a6793177b9fb036fd8ea050cef
|
4
|
+
data.tar.gz: e3f0e38d21dfcc1e03f82733e657e1eb9b05fa33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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.
|
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-
|
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.
|
126
|
+
rubygems_version: 2.5.1
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Reactive Sockets for Ruby
|