cable_room 0.4.4 → 0.4.5

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: 928184ed2b2f5a529bb24cccde6e0048f9c9f5a7ce2b60b62779bc8f06a998ca
4
- data.tar.gz: 440782d877fbdc28948fe8499de860bb0d99c4bcde01b1abb933a23f20a14074
3
+ metadata.gz: 57e1433d4d4cc345377d621c6c1ce693280625909eeab0da36a2d1c43dca13de
4
+ data.tar.gz: d7f1de1afa7a9d527f6682bc1c109f6ee4dd9979399c369bc0bf4a1903f0b4f5
5
5
  SHA512:
6
- metadata.gz: 95047199ea82748e023d3ca246ba942cc4e5845613bd7f76f18c2700e027027f60277f904bc9f3cc5514f808ae7ca4d9305d051fdf40b00d6c280a5fc4e8aba0
7
- data.tar.gz: 5e4e966735dffddf5c074776ea44702dd52b6cd5559a5b814f7d87a03c3fb58e7acfb3b0b7401452b67e9444d7e67d29352ae726c8ab4ba35353e5390495685b
6
+ metadata.gz: 723a2bca5fccb0d7254f0e255b5e1221e73293365af63a56fe17453eb37aa90f8be3ddc20c248c75df3472a89d0802a85b641db971f99446ef692bfb593a25b0
7
+ data.tar.gz: f3c985570d1d8c9361351850da19b4a0371e14268354acb79f3f5fb1bf50246360c7c20a960d7622a53646a0e71d090798587056194079cb62ecf1f47885ea65
@@ -105,6 +105,8 @@ module CableRoom
105
105
  @mutex.synchronize do
106
106
  return if @current_state == :dead || @current_state == :shutting_down
107
107
 
108
+ logger.info "Initiating shutdown: #{reason}"
109
+
108
110
  # Stop streams immediately to prevent further messages from being added
109
111
  stop_all_streams
110
112
 
@@ -75,8 +75,6 @@ module CableRoom
75
75
  end
76
76
  end
77
77
 
78
- protected
79
-
80
78
  def each_room_channel(&blk)
81
79
  @room_channels.dup.each(&blk)
82
80
  end
@@ -14,9 +14,19 @@ module CableRoom
14
14
  runner do
15
15
  end
16
16
 
17
- initializer "cable_room.shutdown" do
18
- Rails.application.reloader.before_class_unload do
19
- CableRoom::ChannelTracker.instance.shutdown_rooms!
17
+ initializer "cable_room.hook_action_cable_restart" do
18
+ module ActionCableServerExtensions
19
+ def restart
20
+ CableRoom::ChannelTracker.instance.each_room_channel do |chan|
21
+ chan.unsubscribe_from_channel
22
+ end
23
+ # CableRoom::ChannelTracker.instance.shutdown_rooms!
24
+ super
25
+ end
26
+ end
27
+
28
+ ActiveSupport.on_load(:action_cable) do
29
+ ActionCable::Server::Base.prepend(ActionCableServerExtensions)
20
30
  end
21
31
  end
22
32
 
@@ -1,3 +1,3 @@
1
1
  module CableRoom
2
- VERSION = "0.4.4".freeze
2
+ VERSION = "0.4.5".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cable_room
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan Knapp