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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c55987f7d6c92030cd96937448d5dea7b62c5dd43292e2d47a5b1901cdcbfa8
4
- data.tar.gz: 6396aaaa64e18e454801debd881e618558ab65bec55de917fd328f0f4cdc041e
3
+ metadata.gz: 40551fbc84bd2fb5894985cfec8b3a7f981f4718bc9bab2d6ac325338b3a5849
4
+ data.tar.gz: 297fd84c27cba4e9779246c3d713af93e4bd0ea5e41edf74ea3200eca017fdb6
5
5
  SHA512:
6
- metadata.gz: 115f8b7d5bc5f8f48cfdb72eb4b81d6128f4b69af919eeaed79693bfb04aa1d09d893ba8970682f74afd417cb46c4176b73ca2b70ed082d0adec9268e8d53010
7
- data.tar.gz: e1c144c6b38c6adca2e96c5e99cbd4a31d52aebe2076e7bd7cc82d2700c0e1f9c11a20d93f32943b6995a6a0e8ba4c20300e6d35170130982403736f64815050
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 << listener
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.delete(listener)
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
@@ -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 << listener
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.delete(listener)
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)
@@ -12,5 +12,5 @@
12
12
 
13
13
  # The Server module
14
14
  module Server
15
- VERSION = '1.0.8'.freeze
15
+ VERSION = '1.0.11'.freeze
16
16
  end
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.8
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-22 00:00:00.000000000 Z
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