actioncable 7.0.4.2 → 7.0.8.7
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 +4 -4
- data/CHANGELOG.md +79 -0
- data/README.md +1 -1
- data/lib/action_cable/connection/base.rb +2 -2
- data/lib/action_cable/gem_version.rb +2 -2
- data/lib/action_cable/subscription_adapter/redis.rb +54 -5
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa0a11a4b00865a2e2481e468e1f1a56b8b99c832346140a858f2b62ba11623c
|
4
|
+
data.tar.gz: 01a1a32f910f093d4ee8c89342f99fae7b9fbdf8a20cb6ef17fe591976d46113
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b61ba77c56d8a85549ae61dbe2d696494aa9f45fe1a4444a4060285c773b6b6287ca2624451f79196145ec0180fa7814ec3ec4b378f02f5721255486e1c4db86
|
7
|
+
data.tar.gz: d8b27954d769da5af3ab1eb6d6f19712df5efa35838d64e6a42d5f6bc9e1993bd14cc80bdfeb7bf9353b1d7437c53a8975b9c320f9117ffe71125f70284806c3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,82 @@
|
|
1
|
+
## Rails 7.0.8.7 (December 10, 2024) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 7.0.8.6 (October 23, 2024) ##
|
7
|
+
|
8
|
+
* No changes.
|
9
|
+
|
10
|
+
|
11
|
+
## Rails 7.0.8.5 (October 15, 2024) ##
|
12
|
+
|
13
|
+
* No changes.
|
14
|
+
|
15
|
+
|
16
|
+
## Rails 7.0.8.4 (June 04, 2024) ##
|
17
|
+
|
18
|
+
* No changes.
|
19
|
+
|
20
|
+
|
21
|
+
## Rails 7.0.8.3 (May 17, 2024) ##
|
22
|
+
|
23
|
+
* No changes.
|
24
|
+
|
25
|
+
|
26
|
+
## Rails 7.0.8.2 (May 16, 2024) ##
|
27
|
+
|
28
|
+
* No changes.
|
29
|
+
|
30
|
+
|
31
|
+
## Rails 7.0.8.1 (February 21, 2024) ##
|
32
|
+
|
33
|
+
* No changes.
|
34
|
+
|
35
|
+
|
36
|
+
## Rails 7.0.8 (September 09, 2023) ##
|
37
|
+
|
38
|
+
* No changes.
|
39
|
+
|
40
|
+
|
41
|
+
## Rails 7.0.7.2 (August 22, 2023) ##
|
42
|
+
|
43
|
+
* No changes.
|
44
|
+
|
45
|
+
|
46
|
+
## Rails 7.0.7.1 (August 22, 2023) ##
|
47
|
+
|
48
|
+
* No changes.
|
49
|
+
|
50
|
+
|
51
|
+
## Rails 7.0.7 (August 09, 2023) ##
|
52
|
+
|
53
|
+
* No changes.
|
54
|
+
|
55
|
+
|
56
|
+
## Rails 7.0.6 (June 29, 2023) ##
|
57
|
+
|
58
|
+
* Fix Action Cable Redis configuration with sentinels.
|
59
|
+
|
60
|
+
*Dmitriy Ivliev*
|
61
|
+
|
62
|
+
|
63
|
+
## Rails 7.0.5.1 (June 26, 2023) ##
|
64
|
+
|
65
|
+
* No changes.
|
66
|
+
|
67
|
+
|
68
|
+
## Rails 7.0.5 (May 24, 2023) ##
|
69
|
+
|
70
|
+
* Restore Action Cable Redis pub/sub listener on connection failure.
|
71
|
+
|
72
|
+
*Vladimir Dementyev*
|
73
|
+
|
74
|
+
|
75
|
+
## Rails 7.0.4.3 (March 13, 2023) ##
|
76
|
+
|
77
|
+
* No changes.
|
78
|
+
|
79
|
+
|
1
80
|
## Rails 7.0.4.2 (January 24, 2023) ##
|
2
81
|
|
3
82
|
* No changes.
|
data/README.md
CHANGED
@@ -237,7 +237,7 @@ module ActionCable
|
|
237
237
|
request.filtered_path,
|
238
238
|
websocket.possible? ? " [WebSocket]" : "[non-WebSocket]",
|
239
239
|
request.ip,
|
240
|
-
Time.now.
|
240
|
+
Time.now.to_default_s ]
|
241
241
|
end
|
242
242
|
|
243
243
|
def finished_request_message
|
@@ -245,7 +245,7 @@ module ActionCable
|
|
245
245
|
request.filtered_path,
|
246
246
|
websocket.possible? ? " [WebSocket]" : "[non-WebSocket]",
|
247
247
|
request.ip,
|
248
|
-
Time.now.
|
248
|
+
Time.now.to_default_s ]
|
249
249
|
end
|
250
250
|
|
251
251
|
def invalid_request_message
|
@@ -46,7 +46,7 @@ module ActionCable
|
|
46
46
|
|
47
47
|
private
|
48
48
|
def listener
|
49
|
-
@listener || @server.mutex.synchronize { @listener ||= Listener.new(self, @server.event_loop) }
|
49
|
+
@listener || @server.mutex.synchronize { @listener ||= Listener.new(self, config_options, @server.event_loop) }
|
50
50
|
end
|
51
51
|
|
52
52
|
def redis_connection_for_broadcasts
|
@@ -56,11 +56,15 @@ module ActionCable
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def redis_connection
|
59
|
-
self.class.redis_connector.call(
|
59
|
+
self.class.redis_connector.call(config_options)
|
60
|
+
end
|
61
|
+
|
62
|
+
def config_options
|
63
|
+
@config_options ||= @server.config.cable.deep_symbolize_keys.merge(id: identifier)
|
60
64
|
end
|
61
65
|
|
62
66
|
class Listener < SubscriberMap
|
63
|
-
def initialize(adapter, event_loop)
|
67
|
+
def initialize(adapter, config_options, event_loop)
|
64
68
|
super()
|
65
69
|
|
66
70
|
@adapter = adapter
|
@@ -69,6 +73,11 @@ module ActionCable
|
|
69
73
|
@subscribe_callbacks = Hash.new { |h, k| h[k] = [] }
|
70
74
|
@subscription_lock = Mutex.new
|
71
75
|
|
76
|
+
@reconnect_attempt = 0
|
77
|
+
# Use the same config as used by Redis conn
|
78
|
+
@reconnect_attempts = config_options.fetch(:reconnect_attempts, 1)
|
79
|
+
@reconnect_attempts = Array.new(@reconnect_attempts, 0) if @reconnect_attempts.is_a?(Integer)
|
80
|
+
|
72
81
|
@subscribed_client = nil
|
73
82
|
|
74
83
|
@when_connected = []
|
@@ -84,6 +93,7 @@ module ActionCable
|
|
84
93
|
on.subscribe do |chan, count|
|
85
94
|
@subscription_lock.synchronize do
|
86
95
|
if count == 1
|
96
|
+
@reconnect_attempt = 0
|
87
97
|
@subscribed_client = original_client
|
88
98
|
|
89
99
|
until @when_connected.empty?
|
@@ -150,8 +160,16 @@ module ActionCable
|
|
150
160
|
@thread ||= Thread.new do
|
151
161
|
Thread.current.abort_on_exception = true
|
152
162
|
|
153
|
-
|
154
|
-
|
163
|
+
begin
|
164
|
+
conn = @adapter.redis_connection_for_subscriptions
|
165
|
+
listen conn
|
166
|
+
rescue ConnectionError
|
167
|
+
reset
|
168
|
+
if retry_connecting?
|
169
|
+
when_connected { resubscribe }
|
170
|
+
retry
|
171
|
+
end
|
172
|
+
end
|
155
173
|
end
|
156
174
|
end
|
157
175
|
|
@@ -163,7 +181,36 @@ module ActionCable
|
|
163
181
|
end
|
164
182
|
end
|
165
183
|
|
184
|
+
def retry_connecting?
|
185
|
+
@reconnect_attempt += 1
|
186
|
+
|
187
|
+
return false if @reconnect_attempt > @reconnect_attempts.size
|
188
|
+
|
189
|
+
sleep_t = @reconnect_attempts[@reconnect_attempt - 1]
|
190
|
+
|
191
|
+
sleep(sleep_t) if sleep_t > 0
|
192
|
+
|
193
|
+
true
|
194
|
+
end
|
195
|
+
|
196
|
+
def resubscribe
|
197
|
+
channels = @sync.synchronize do
|
198
|
+
@subscribers.keys
|
199
|
+
end
|
200
|
+
@subscribed_client.subscribe(*channels) unless channels.empty?
|
201
|
+
end
|
202
|
+
|
203
|
+
def reset
|
204
|
+
@subscription_lock.synchronize do
|
205
|
+
@subscribed_client = nil
|
206
|
+
@subscribe_callbacks.clear
|
207
|
+
@when_connected.clear
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
166
211
|
if ::Redis::VERSION < "5"
|
212
|
+
ConnectionError = ::Redis::ConnectionError
|
213
|
+
|
167
214
|
class SubscribedClient
|
168
215
|
def initialize(raw_client)
|
169
216
|
@raw_client = raw_client
|
@@ -197,6 +244,8 @@ module ActionCable
|
|
197
244
|
SubscribedClient.new(raw_client)
|
198
245
|
end
|
199
246
|
else
|
247
|
+
ConnectionError = RedisClient::ConnectionError
|
248
|
+
|
200
249
|
def extract_subscribed_client(conn)
|
201
250
|
conn
|
202
251
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actioncable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pratik Naik
|
8
8
|
- David Heinemeier Hansson
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 7.0.
|
20
|
+
version: 7.0.8.7
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 7.0.
|
27
|
+
version: 7.0.8.7
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: actionpack
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 7.0.
|
34
|
+
version: 7.0.8.7
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 7.0.
|
41
|
+
version: 7.0.8.7
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: nio4r
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,12 +142,12 @@ licenses:
|
|
142
142
|
- MIT
|
143
143
|
metadata:
|
144
144
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
145
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
146
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
145
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.8.7/actioncable/CHANGELOG.md
|
146
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.8.7/
|
147
147
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
148
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
148
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.8.7/actioncable
|
149
149
|
rubygems_mfa_required: 'true'
|
150
|
-
post_install_message:
|
150
|
+
post_install_message:
|
151
151
|
rdoc_options: []
|
152
152
|
require_paths:
|
153
153
|
- lib
|
@@ -162,8 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
166
|
-
signing_key:
|
165
|
+
rubygems_version: 3.5.22
|
166
|
+
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: WebSocket framework for Rails.
|
169
169
|
test_files: []
|