tcp-server 1.0.8-java → 1.0.11-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/client.rb +11 -4
- data/lib/server/channel_initializer.rb +6 -2
- data/lib/server/instance_methods.rb +6 -2
- data/lib/server/listenable.rb +9 -4
- data/lib/server/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40551fbc84bd2fb5894985cfec8b3a7f981f4718bc9bab2d6ac325338b3a5849
|
4
|
+
data.tar.gz: 297fd84c27cba4e9779246c3d713af93e4bd0ea5e41edf74ea3200eca017fdb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86b9bad538567c8ea538a362ce4780e45a32d4220d61d1c97d1cb861b379e5fb01b643edb432b792e8f94386e8d45f74ad43c21c2554f865a3628770e5b327bb
|
7
|
+
data.tar.gz: e8b92bf9a69641295bef0d375bd83444fc61230a4cd6faa36ba145f28b88129403e3e3bb49cb0d31a2c97b25405359eb7de9dabbd7f2d51e9cad97d3421588e5
|
data/lib/client.rb
CHANGED
@@ -230,14 +230,19 @@ module Client
|
|
230
230
|
@listeners ||= java.util.concurrent.CopyOnWriteArrayList.new
|
231
231
|
end
|
232
232
|
|
233
|
-
def add_listener(listener)
|
234
|
-
listeners
|
233
|
+
def add_listener(*listener)
|
234
|
+
listeners.addAll(listener)
|
235
235
|
ensure
|
236
236
|
log.trace "Listeners: #{listeners}"
|
237
237
|
end
|
238
238
|
|
239
|
-
def remove_listener(listener)
|
240
|
-
listeners.
|
239
|
+
def remove_listener(*listener)
|
240
|
+
listeners.removeAll(listener)
|
241
|
+
end
|
242
|
+
|
243
|
+
def replace_listeners(*listener)
|
244
|
+
listeners.clear
|
245
|
+
add_listener(*listener)
|
241
246
|
end
|
242
247
|
|
243
248
|
def notify(event, *args)
|
@@ -248,7 +253,9 @@ module Client
|
|
248
253
|
end
|
249
254
|
end
|
250
255
|
end
|
256
|
+
# module Listenable
|
251
257
|
end
|
258
|
+
# module Client
|
252
259
|
|
253
260
|
# The Client module
|
254
261
|
module Client
|
@@ -62,8 +62,12 @@ module Server
|
|
62
62
|
@default_handler ||= ::Server::ModularHandler.new(@channel_group)
|
63
63
|
end
|
64
64
|
|
65
|
-
def add_listener(listener)
|
66
|
-
default_handler.add_listener(listener)
|
65
|
+
def add_listener(*listener)
|
66
|
+
default_handler.add_listener(*listener)
|
67
|
+
end
|
68
|
+
|
69
|
+
def replace_listeners(*listener)
|
70
|
+
default_handler.replace_listeners(*listener)
|
67
71
|
end
|
68
72
|
|
69
73
|
protected
|
@@ -96,8 +96,12 @@ module Server
|
|
96
96
|
channel_initializer << handler
|
97
97
|
end
|
98
98
|
|
99
|
-
def add_listener(listener)
|
100
|
-
channel_initializer.add_listener(listener)
|
99
|
+
def add_listener(*listener)
|
100
|
+
channel_initializer.add_listener(*listener)
|
101
|
+
end
|
102
|
+
|
103
|
+
def replace_listeners(*listener)
|
104
|
+
channel_initializer.replace_listeners(*listener)
|
101
105
|
end
|
102
106
|
end
|
103
107
|
# module ServerInstanceMethods
|
data/lib/server/listenable.rb
CHANGED
@@ -20,14 +20,19 @@ module Server
|
|
20
20
|
@listeners ||= java.util.concurrent.CopyOnWriteArrayList.new
|
21
21
|
end
|
22
22
|
|
23
|
-
def add_listener(listener)
|
24
|
-
listeners
|
23
|
+
def add_listener(*listener)
|
24
|
+
listeners.addAll(listener)
|
25
25
|
ensure
|
26
26
|
log.trace "Listeners: #{listeners}"
|
27
27
|
end
|
28
28
|
|
29
|
-
def remove_listener(listener)
|
30
|
-
listeners.
|
29
|
+
def remove_listener(*listener)
|
30
|
+
listeners.removeAll(listener)
|
31
|
+
end
|
32
|
+
|
33
|
+
def replace_listeners(*listener)
|
34
|
+
listeners.clear
|
35
|
+
add_listener(*listener)
|
31
36
|
end
|
32
37
|
|
33
38
|
def notify(event, *args)
|
data/lib/server/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tcp-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Nels Nelson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|