async_cable 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: 998abf5f3d5c77b7708cc89f7959e96240c41d1e9d03969b835dfe6feb3bd965
4
- data.tar.gz: 598c96f04bd6081fbb87f4652ef5c7934e6bc0ca56f6b7fa71af3dce2413f8ea
3
+ metadata.gz: 1307eaa250ca919e08bf9750306356da5617fa17e83ac22a7794cfe283c54044
4
+ data.tar.gz: 2ff42ee0b91c24e3920e57bc24d55f6d75ece88f37fde977287842688167af01
5
5
  SHA512:
6
- metadata.gz: 8e46330cb55642128c2dc7023b93aa2137605bb5cfa3c8fbfc19c834eab67acb8a62fa2941367235d575555e2084ad7a21e2befc907582f2c57281fc1131f6b4
7
- data.tar.gz: 93bcf416e3e8a6c116d26a2a2e66cfbb440009933712aa0155f52465e03add44057080adf7f941943215fde75881c06c8d64fd0fae85be428de2de37fd6c3a4d
6
+ metadata.gz: b88b3c263dc2f3f7e93a727a5fa6a841bece8971f5a1cb9a97df805ddf48a746182e7de4e0712b1b3249859a5ad612f62c8e30491ff407d1e6da405b6e92a631
7
+ data.tar.gz: 4d0a20448b97a493414d3d92d0191e98f27a9d350c76611ecf15442fdc6d7024251bf14d2e5f266da92e597e5dbff4a429becca56382d84033b6de6fe371e354
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+ ### 0.2.2
6
+ * fix connection logging
7
+ * fix registry
8
+ * fix server exception handling
9
+
5
10
  ### 0.2.1
6
11
  * fix registry
7
12
 
@@ -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 identifier=#{identifier} data=#{data.inspect}" }
65
+ logger.debug { "#{self.class}#transmit stream_name=#{stream_name} data=#{data.inspect}" }
66
66
 
67
67
  @mutex.synchronize do
68
68
  write(data)
@@ -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] = []; h }
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
@@ -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::Connection::Error => error
31
+ rescue AsyncCable::Errors::Error => error
32
32
  connection.close_code = error.code
33
33
  connection.close_reason = error.message
34
34
  ensure
@@ -1,3 +1,3 @@
1
1
  module AsyncCable
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
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.1
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-03 00:00:00.000000000 Z
11
+ date: 2020-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-websocket