async_cable 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/async_cable/connection.rb +1 -1
- data/lib/async_cable/registry.rb +8 -3
- data/lib/async_cable/server.rb +1 -1
- data/lib/async_cable/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: 1307eaa250ca919e08bf9750306356da5617fa17e83ac22a7794cfe283c54044
|
4
|
+
data.tar.gz: 2ff42ee0b91c24e3920e57bc24d55f6d75ece88f37fde977287842688167af01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b88b3c263dc2f3f7e93a727a5fa6a841bece8971f5a1cb9a97df805ddf48a746182e7de4e0712b1b3249859a5ad612f62c8e30491ff407d1e6da405b6e92a631
|
7
|
+
data.tar.gz: 4d0a20448b97a493414d3d92d0191e98f27a9d350c76611ecf15442fdc6d7024251bf14d2e5f266da92e597e5dbff4a429becca56382d84033b6de6fe371e354
|
data/CHANGELOG.md
CHANGED
@@ -62,7 +62,7 @@ module AsyncCable
|
|
62
62
|
# call this method to transmit data to current WS client
|
63
63
|
# @param data [Hash]
|
64
64
|
def transmit(data)
|
65
|
-
logger.debug { "#{self.class}#transmit
|
65
|
+
logger.debug { "#{self.class}#transmit stream_name=#{stream_name} data=#{data.inspect}" }
|
66
66
|
|
67
67
|
@mutex.synchronize do
|
68
68
|
write(data)
|
data/lib/async_cable/registry.rb
CHANGED
@@ -5,7 +5,6 @@ module AsyncCable
|
|
5
5
|
class Registry
|
6
6
|
include Singleton
|
7
7
|
extend SingleForwardable
|
8
|
-
@mutex = Mutex.new
|
9
8
|
|
10
9
|
single_delegate [:add, :remove, :find, :each] => :instance
|
11
10
|
|
@@ -55,6 +54,11 @@ module AsyncCable
|
|
55
54
|
Util.each_async(list, &block)
|
56
55
|
end
|
57
56
|
|
57
|
+
def init_mutex
|
58
|
+
@mutex ||= Mutex.new
|
59
|
+
true
|
60
|
+
end
|
61
|
+
|
58
62
|
private
|
59
63
|
|
60
64
|
def subscribers
|
@@ -63,9 +67,10 @@ module AsyncCable
|
|
63
67
|
|
64
68
|
def new_subscribers
|
65
69
|
Hash.new do |hash, channel_name|
|
66
|
-
hash[channel_name] = Hash.new { |h, stream_name| h[stream_name] = []
|
67
|
-
hash
|
70
|
+
hash[channel_name] = Hash.new { |h, stream_name| h[stream_name] = [] }
|
68
71
|
end
|
69
72
|
end
|
73
|
+
|
74
|
+
instance.init_mutex
|
70
75
|
end
|
71
76
|
end
|
data/lib/async_cable/server.rb
CHANGED
@@ -28,7 +28,7 @@ module AsyncCable
|
|
28
28
|
logger.debug { "#{self.class}#call rescue #{error.class} message=#{error.message} code=#{error.code}" }
|
29
29
|
connection.close_code = error.code
|
30
30
|
connection.close_reason = error.message
|
31
|
-
rescue AsyncCable::
|
31
|
+
rescue AsyncCable::Errors::Error => error
|
32
32
|
connection.close_code = error.code
|
33
33
|
connection.close_reason = error.message
|
34
34
|
ensure
|
data/lib/async_cable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async_cable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Talakevich
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-websocket
|