rails_type_id 0.1.0

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.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +25 -0
  3. data/.ruby-version +1 -0
  4. data/README.md +46 -0
  5. data/Rakefile +16 -0
  6. data/lib/rails_type_id/concern.rb +129 -0
  7. data/lib/rails_type_id/require.rb +6 -0
  8. data/lib/rails_type_id/test_helper.rb +16 -0
  9. data/lib/rails_type_id/version.rb +6 -0
  10. data/lib/rails_type_id.rb +9 -0
  11. data/lib/tapioca/dsl/compilers/rails_type_id_compiler.rb +49 -0
  12. data/sig/rails_type_id.rbs +4 -0
  13. data/sorbet/config +4 -0
  14. data/sorbet/rbi/annotations/.gitattributes +1 -0
  15. data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
  16. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  17. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  18. data/sorbet/rbi/annotations/activejob.rbi +44 -0
  19. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  20. data/sorbet/rbi/annotations/activerecord.rbi +98 -0
  21. data/sorbet/rbi/annotations/activesupport.rbi +468 -0
  22. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  23. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  24. data/sorbet/rbi/annotations/railties.rbi +61 -0
  25. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  26. data/sorbet/rbi/dsl/.gitattributes +1 -0
  27. data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +21 -0
  28. data/sorbet/rbi/dsl/active_model/validations.rbi +26 -0
  29. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  30. data/sorbet/rbi/dsl/rails_type_id/concern.rbi +22 -0
  31. data/sorbet/rbi/gems/.gitattributes +1 -0
  32. data/sorbet/rbi/gems/actioncable@8.0.2.rbi +3133 -0
  33. data/sorbet/rbi/gems/actionmailbox@8.0.2.rbi +991 -0
  34. data/sorbet/rbi/gems/actionmailer@8.0.2.rbi +2775 -0
  35. data/sorbet/rbi/gems/actionpack@8.0.2.rbi +21167 -0
  36. data/sorbet/rbi/gems/actiontext@8.0.2.rbi +1449 -0
  37. data/sorbet/rbi/gems/actionview@8.0.2.rbi +15789 -0
  38. data/sorbet/rbi/gems/activejob@8.0.2.rbi +2864 -0
  39. data/sorbet/rbi/gems/activemodel@8.0.2.rbi +6946 -0
  40. data/sorbet/rbi/gems/activerecord@8.0.2.rbi +42458 -0
  41. data/sorbet/rbi/gems/activestorage@8.0.2.rbi +2156 -0
  42. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +21274 -0
  43. data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
  44. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  45. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  46. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +275 -0
  47. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  48. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11734 -0
  49. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
  50. data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
  51. data/sorbet/rbi/gems/date@3.4.1.rbi +403 -0
  52. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  53. data/sorbet/rbi/gems/erb@5.0.2.rbi +878 -0
  54. data/sorbet/rbi/gems/erubi@1.13.1.rbi +157 -0
  55. data/sorbet/rbi/gems/globalid@1.2.1.rbi +742 -0
  56. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2383 -0
  57. data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
  58. data/sorbet/rbi/gems/json@2.12.2.rbi +2287 -0
  59. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  60. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
  61. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  62. data/sorbet/rbi/gems/loofah@2.24.1.rbi +1105 -0
  63. data/sorbet/rbi/gems/mail@2.8.1.rbi +8890 -0
  64. data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
  65. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
  66. data/sorbet/rbi/gems/minitest@5.25.5.rbi +2231 -0
  67. data/sorbet/rbi/gems/net-imap@0.5.9.rbi +10285 -0
  68. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
  69. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
  70. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +1240 -0
  71. data/sorbet/rbi/gems/netrc@0.11.0.rbi +177 -0
  72. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +388 -0
  73. data/sorbet/rbi/gems/nokogiri@1.18.9.rbi +8548 -0
  74. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  75. data/sorbet/rbi/gems/parser@3.3.9.0.rbi +5537 -0
  76. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  77. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  78. data/sorbet/rbi/gems/prism@1.4.0.rbi +41790 -0
  79. data/sorbet/rbi/gems/psych@5.2.6.rbi +2542 -0
  80. data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
  81. data/sorbet/rbi/gems/rack-session@2.1.1.rbi +722 -0
  82. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +729 -0
  83. data/sorbet/rbi/gems/rack@3.2.0.rbi +5054 -0
  84. data/sorbet/rbi/gems/rackup@2.2.1.rbi +230 -0
  85. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +790 -0
  86. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +645 -0
  87. data/sorbet/rbi/gems/rails@8.0.2.rbi +9 -0
  88. data/sorbet/rbi/gems/railties@8.0.2.rbi +4014 -0
  89. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  90. data/sorbet/rbi/gems/rake@13.3.0.rbi +3039 -0
  91. data/sorbet/rbi/gems/rbi@0.3.6.rbi +5162 -0
  92. data/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi +7895 -0
  93. data/sorbet/rbi/gems/rdoc@6.14.2.rbi +12944 -0
  94. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3833 -0
  95. data/sorbet/rbi/gems/reline@0.6.2.rbi +9 -0
  96. data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
  97. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5205 -0
  98. data/sorbet/rbi/gems/rubocop-ast@1.46.0.rbi +7473 -0
  99. data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
  100. data/sorbet/rbi/gems/rubocop@1.79.1.rbi +63674 -0
  101. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  102. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  103. data/sorbet/rbi/gems/spoom@1.7.5.rbi +5832 -0
  104. data/sorbet/rbi/gems/sqlite3@2.7.3.rbi +1989 -0
  105. data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
  106. data/sorbet/rbi/gems/tapioca@0.17.7.rbi +3692 -0
  107. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  108. data/sorbet/rbi/gems/timeout@0.4.3.rbi +157 -0
  109. data/sorbet/rbi/gems/typeid@0.2.2.rbi +239 -0
  110. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5919 -0
  111. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  112. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  113. data/sorbet/rbi/gems/uri@1.0.3.rbi +2354 -0
  114. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  115. data/sorbet/rbi/gems/uuid7@0.2.0.rbi +60 -0
  116. data/sorbet/rbi/gems/websocket-driver@0.8.0.rbi +1065 -0
  117. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +117 -0
  118. data/sorbet/rbi/gems/with_model@2.2.0.rbi +282 -0
  119. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +430 -0
  120. data/sorbet/rbi/gems/yard@0.9.37.rbi +18512 -0
  121. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1196 -0
  122. data/sorbet/tapioca/config.yml +13 -0
  123. data/sorbet/tapioca/require.rb +13 -0
  124. metadata +208 -0
@@ -0,0 +1,3133 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `actioncable` gem.
5
+ # Please instead update this file by running `bin/tapioca gem actioncable`.
6
+
7
+
8
+ # :markup: markdown
9
+ # :include: ../README.md
10
+ #
11
+ # source://actioncable//lib/action_cable.rb#54
12
+ module ActionCable
13
+ private
14
+
15
+ # Singleton instance of the server
16
+ #
17
+ # source://actioncable//lib/action_cable.rb#77
18
+ def server; end
19
+
20
+ class << self
21
+ # source://actioncable//lib/action_cable/deprecator.rb#6
22
+ def deprecator; end
23
+
24
+ # Returns the currently loaded version of Action Cable as a `Gem::Version`.
25
+ #
26
+ # source://actioncable//lib/action_cable/gem_version.rb#7
27
+ def gem_version; end
28
+
29
+ # Singleton instance of the server
30
+ #
31
+ # source://actioncable//lib/action_cable.rb#77
32
+ def server; end
33
+
34
+ # Returns the currently loaded version of Action Cable as a `Gem::Version`.
35
+ #
36
+ # source://actioncable//lib/action_cable/version.rb#9
37
+ def version; end
38
+ end
39
+ end
40
+
41
+ # source://actioncable//lib/action_cable/channel/base.rb#9
42
+ module ActionCable::Channel; end
43
+
44
+ # # Action Cable Channel Base
45
+ #
46
+ # The channel provides the basic structure of grouping behavior into logical
47
+ # units when communicating over the WebSocket connection. You can think of a
48
+ # channel like a form of controller, but one that's capable of pushing content
49
+ # to the subscriber in addition to simply responding to the subscriber's direct
50
+ # requests.
51
+ #
52
+ # Channel instances are long-lived. A channel object will be instantiated when
53
+ # the cable consumer becomes a subscriber, and then lives until the consumer
54
+ # disconnects. This may be seconds, minutes, hours, or even days. That means you
55
+ # have to take special care not to do anything silly in a channel that would
56
+ # balloon its memory footprint or whatever. The references are forever, so they
57
+ # won't be released as is normally the case with a controller instance that gets
58
+ # thrown away after every request.
59
+ #
60
+ # Long-lived channels (and connections) also mean you're responsible for
61
+ # ensuring that the data is fresh. If you hold a reference to a user record, but
62
+ # the name is changed while that reference is held, you may be sending stale
63
+ # data if you don't take precautions to avoid it.
64
+ #
65
+ # The upside of long-lived channel instances is that you can use instance
66
+ # variables to keep reference to objects that future subscriber requests can
67
+ # interact with. Here's a quick example:
68
+ #
69
+ # class ChatChannel < ApplicationCable::Channel
70
+ # def subscribed
71
+ # @room = Chat::Room[params[:room_number]]
72
+ # end
73
+ #
74
+ # def speak(data)
75
+ # @room.speak data, user: current_user
76
+ # end
77
+ # end
78
+ #
79
+ # The #speak action simply uses the Chat::Room object that was created when the
80
+ # channel was first subscribed to by the consumer when that subscriber wants to
81
+ # say something in the room.
82
+ #
83
+ # ## Action processing
84
+ #
85
+ # Unlike subclasses of ActionController::Base, channels do not follow a RESTful
86
+ # constraint form for their actions. Instead, Action Cable operates through a
87
+ # remote-procedure call model. You can declare any public method on the channel
88
+ # (optionally taking a `data` argument), and this method is automatically
89
+ # exposed as callable to the client.
90
+ #
91
+ # Example:
92
+ #
93
+ # class AppearanceChannel < ApplicationCable::Channel
94
+ # def subscribed
95
+ # @connection_token = generate_connection_token
96
+ # end
97
+ #
98
+ # def unsubscribed
99
+ # current_user.disappear @connection_token
100
+ # end
101
+ #
102
+ # def appear(data)
103
+ # current_user.appear @connection_token, on: data['appearing_on']
104
+ # end
105
+ #
106
+ # def away
107
+ # current_user.away @connection_token
108
+ # end
109
+ #
110
+ # private
111
+ # def generate_connection_token
112
+ # SecureRandom.hex(36)
113
+ # end
114
+ # end
115
+ #
116
+ # In this example, the subscribed and unsubscribed methods are not callable
117
+ # methods, as they were already declared in ActionCable::Channel::Base, but
118
+ # `#appear` and `#away` are. `#generate_connection_token` is also not callable,
119
+ # since it's a private method. You'll see that appear accepts a data parameter,
120
+ # which it then uses as part of its model call. `#away` does not, since it's
121
+ # simply a trigger action.
122
+ #
123
+ # Also note that in this example, `current_user` is available because it was
124
+ # marked as an identifying attribute on the connection. All such identifiers
125
+ # will automatically create a delegation method of the same name on the channel
126
+ # instance.
127
+ #
128
+ # ## Rejecting subscription requests
129
+ #
130
+ # A channel can reject a subscription request in the #subscribed callback by
131
+ # invoking the #reject method:
132
+ #
133
+ # class ChatChannel < ApplicationCable::Channel
134
+ # def subscribed
135
+ # @room = Chat::Room[params[:room_number]]
136
+ # reject unless current_user.can_access?(@room)
137
+ # end
138
+ # end
139
+ #
140
+ # In this example, the subscription will be rejected if the `current_user` does
141
+ # not have access to the chat room. On the client-side, the `Channel#rejected`
142
+ # callback will get invoked when the server rejects the subscription request.
143
+ #
144
+ # source://actioncable//lib/action_cable/channel/base.rb#109
145
+ class ActionCable::Channel::Base
146
+ include ::ActiveSupport::Callbacks
147
+ include ::ActionCable::Channel::Callbacks
148
+ include ::ActionCable::Channel::PeriodicTimers
149
+ include ::ActionCable::Channel::Streams
150
+ include ::ActionCable::Channel::Naming
151
+ include ::ActionCable::Channel::Broadcasting
152
+ include ::ActiveSupport::Rescuable
153
+ extend ::ActiveSupport::Callbacks::ClassMethods
154
+ extend ::ActiveSupport::DescendantsTracker
155
+ extend ::ActionCable::Channel::Callbacks::ClassMethods
156
+ extend ::ActionCable::Channel::PeriodicTimers::ClassMethods
157
+ extend ::ActionCable::Channel::Naming::ClassMethods
158
+ extend ::ActionCable::Channel::Broadcasting::ClassMethods
159
+ extend ::ActiveSupport::Rescuable::ClassMethods
160
+
161
+ # @return [Base] a new instance of Base
162
+ #
163
+ # source://actioncable//lib/action_cable/channel/base.rb#150
164
+ def initialize(connection, identifier, params = T.unsafe(nil)); end
165
+
166
+ # source://actioncable//lib/action_cable/channel/base.rb#110
167
+ def __callbacks; end
168
+
169
+ # source://actioncable//lib/action_cable/channel/base.rb#110
170
+ def _run_subscribe_callbacks(&block); end
171
+
172
+ # source://actioncable//lib/action_cable/channel/base.rb#110
173
+ def _run_unsubscribe_callbacks(&block); end
174
+
175
+ # source://actioncable//lib/action_cable/channel/base.rb#110
176
+ def _subscribe_callbacks; end
177
+
178
+ # source://actioncable//lib/action_cable/channel/base.rb#110
179
+ def _unsubscribe_callbacks; end
180
+
181
+ # Returns the value of attribute connection.
182
+ #
183
+ # source://actioncable//lib/action_cable/channel/base.rb#117
184
+ def connection; end
185
+
186
+ # Returns the value of attribute identifier.
187
+ #
188
+ # source://actioncable//lib/action_cable/channel/base.rb#117
189
+ def identifier; end
190
+
191
+ # source://actioncable//lib/action_cable/channel/base.rb#118
192
+ def logger(*_arg0, **_arg1, &_arg2); end
193
+
194
+ # Returns the value of attribute params.
195
+ #
196
+ # source://actioncable//lib/action_cable/channel/base.rb#117
197
+ def params; end
198
+
199
+ # Extract the action name from the passed data and process it via the channel.
200
+ # The process will ensure that the action requested is a public method on the
201
+ # channel declared by the user (so not one of the callbacks like #subscribed).
202
+ #
203
+ # source://actioncable//lib/action_cable/channel/base.rb#150
204
+ def perform_action(data); end
205
+
206
+ # source://actioncable//lib/action_cable/channel/base.rb#111
207
+ def periodic_timers=(_arg0); end
208
+
209
+ # source://actioncable//lib/action_cable/channel/base.rb#115
210
+ def rescue_handlers; end
211
+
212
+ # source://actioncable//lib/action_cable/channel/base.rb#115
213
+ def rescue_handlers=(_arg0); end
214
+
215
+ # source://actioncable//lib/action_cable/channel/base.rb#115
216
+ def rescue_handlers?; end
217
+
218
+ # This method is called after subscription has been added to the connection and
219
+ # confirms or rejects the subscription.
220
+ #
221
+ # source://actioncable//lib/action_cable/channel/base.rb#150
222
+ def subscribe_to_channel; end
223
+
224
+ # Called by the cable connection when it's cut, so the channel has a chance to
225
+ # cleanup with callbacks. This method is not intended to be called directly by
226
+ # the user. Instead, override the #unsubscribed callback.
227
+ #
228
+ # source://actioncable//lib/action_cable/channel/base.rb#150
229
+ def unsubscribe_from_channel; end
230
+
231
+ private
232
+
233
+ # source://actioncable//lib/action_cable/channel/base.rb#150
234
+ def action_signature(action, data); end
235
+
236
+ # source://actioncable//lib/action_cable/channel/base.rb#150
237
+ def defer_subscription_confirmation!; end
238
+
239
+ # @return [Boolean]
240
+ #
241
+ # source://actioncable//lib/action_cable/channel/base.rb#150
242
+ def defer_subscription_confirmation?; end
243
+
244
+ # source://actioncable//lib/action_cable/channel/base.rb#150
245
+ def delegate_connection_identifiers; end
246
+
247
+ # source://actioncable//lib/action_cable/channel/base.rb#150
248
+ def dispatch_action(action, data); end
249
+
250
+ # source://actioncable//lib/action_cable/channel/base.rb#150
251
+ def ensure_confirmation_sent; end
252
+
253
+ # source://actioncable//lib/action_cable/channel/base.rb#150
254
+ def extract_action(data); end
255
+
256
+ # source://actioncable//lib/action_cable/channel/base.rb#150
257
+ def parameter_filter; end
258
+
259
+ # @return [Boolean]
260
+ #
261
+ # source://actioncable//lib/action_cable/channel/base.rb#150
262
+ def processable_action?(action); end
263
+
264
+ # source://actioncable//lib/action_cable/channel/base.rb#150
265
+ def reject; end
266
+
267
+ # source://actioncable//lib/action_cable/channel/base.rb#150
268
+ def reject_subscription; end
269
+
270
+ # Called once a consumer has become a subscriber of the channel. Usually the
271
+ # place to set up any streams you want this channel to be sending to the
272
+ # subscriber.
273
+ #
274
+ # source://actioncable//lib/action_cable/channel/base.rb#150
275
+ def subscribed; end
276
+
277
+ # @return [Boolean]
278
+ #
279
+ # source://actioncable//lib/action_cable/channel/base.rb#150
280
+ def subscription_confirmation_sent?; end
281
+
282
+ # @return [Boolean]
283
+ #
284
+ # source://actioncable//lib/action_cable/channel/base.rb#150
285
+ def subscription_rejected?; end
286
+
287
+ # Transmit a hash of data to the subscriber. The hash will automatically be
288
+ # wrapped in a JSON envelope with the proper channel identifier marked as the
289
+ # recipient.
290
+ #
291
+ # source://actioncable//lib/action_cable/channel/base.rb#150
292
+ def transmit(data, via: T.unsafe(nil)); end
293
+
294
+ # source://actioncable//lib/action_cable/channel/base.rb#150
295
+ def transmit_subscription_confirmation; end
296
+
297
+ # source://actioncable//lib/action_cable/channel/base.rb#150
298
+ def transmit_subscription_rejection; end
299
+
300
+ # Called once a consumer has cut its cable connection. Can be used for cleaning
301
+ # up connections or marking users as offline or the like.
302
+ #
303
+ # source://actioncable//lib/action_cable/channel/base.rb#150
304
+ def unsubscribed; end
305
+
306
+ class << self
307
+ # source://actioncable//lib/action_cable/channel/base.rb#110
308
+ def __callbacks; end
309
+
310
+ # source://actioncable//lib/action_cable/channel/base.rb#110
311
+ def __callbacks=(value); end
312
+
313
+ # source://actioncable//lib/action_cable/channel/base.rb#110
314
+ def _subscribe_callbacks; end
315
+
316
+ # source://actioncable//lib/action_cable/channel/base.rb#110
317
+ def _subscribe_callbacks=(value); end
318
+
319
+ # source://actioncable//lib/action_cable/channel/base.rb#110
320
+ def _unsubscribe_callbacks; end
321
+
322
+ # source://actioncable//lib/action_cable/channel/base.rb#110
323
+ def _unsubscribe_callbacks=(value); end
324
+
325
+ # A list of method names that should be considered actions. This includes all
326
+ # public instance methods on a channel, less any internal methods (defined on
327
+ # Base), adding back in any methods that are internal, but still exist on the
328
+ # class itself.
329
+ #
330
+ # #### Returns
331
+ # * `Set` - A set of all methods that should be considered actions.
332
+ #
333
+ # source://actioncable//lib/action_cable/channel/base.rb#128
334
+ def action_methods; end
335
+
336
+ # source://actioncable//lib/action_cable/channel/base.rb#111
337
+ def periodic_timers; end
338
+
339
+ # source://actioncable//lib/action_cable/channel/base.rb#111
340
+ def periodic_timers=(value); end
341
+
342
+ # source://actioncable//lib/action_cable/channel/base.rb#111
343
+ def periodic_timers?; end
344
+
345
+ # source://actioncable//lib/action_cable/channel/base.rb#115
346
+ def rescue_handlers; end
347
+
348
+ # source://actioncable//lib/action_cable/channel/base.rb#115
349
+ def rescue_handlers=(value); end
350
+
351
+ # source://actioncable//lib/action_cable/channel/base.rb#115
352
+ def rescue_handlers?; end
353
+
354
+ private
355
+
356
+ # source://actioncable//lib/action_cable/channel/base.rb#110
357
+ def __class_attr___callbacks; end
358
+
359
+ # source://actioncable//lib/action_cable/channel/base.rb#110
360
+ def __class_attr___callbacks=(new_value); end
361
+
362
+ # source://actioncable//lib/action_cable/channel/base.rb#111
363
+ def __class_attr_periodic_timers; end
364
+
365
+ # source://actioncable//lib/action_cable/channel/base.rb#111
366
+ def __class_attr_periodic_timers=(new_value); end
367
+
368
+ # source://actioncable//lib/action_cable/channel/base.rb#115
369
+ def __class_attr_rescue_handlers; end
370
+
371
+ # source://actioncable//lib/action_cable/channel/base.rb#115
372
+ def __class_attr_rescue_handlers=(new_value); end
373
+
374
+ # action_methods are cached and there is sometimes need to refresh them.
375
+ # ::clear_action_methods! allows you to do that, so next time you run
376
+ # action_methods, they will be recalculated.
377
+ #
378
+ # source://actioncable//lib/action_cable/channel/base.rb#144
379
+ def clear_action_methods!; end
380
+
381
+ # Refresh the cached action_methods when a new action_method is added.
382
+ #
383
+ # source://actioncable//lib/action_cable/channel/base.rb#149
384
+ def method_added(name); end
385
+ end
386
+ end
387
+
388
+ # source://actioncable//lib/action_cable/channel/broadcasting.rb#9
389
+ module ActionCable::Channel::Broadcasting
390
+ extend ::ActiveSupport::Concern
391
+
392
+ mixes_in_class_methods ::ActionCable::Channel::Broadcasting::ClassMethods
393
+
394
+ # source://actioncable//lib/action_cable/channel/broadcasting.rb#45
395
+ def broadcast_to(model, message); end
396
+
397
+ # source://actioncable//lib/action_cable/channel/broadcasting.rb#41
398
+ def broadcasting_for(model); end
399
+ end
400
+
401
+ # source://actioncable//lib/action_cable/channel/broadcasting.rb#12
402
+ module ActionCable::Channel::Broadcasting::ClassMethods
403
+ # Broadcast a hash to a unique broadcasting for this `model` in this channel.
404
+ #
405
+ # source://actioncable//lib/action_cable/channel/broadcasting.rb#14
406
+ def broadcast_to(model, message); end
407
+
408
+ # Returns a unique broadcasting identifier for this `model` in this channel:
409
+ #
410
+ # CommentsChannel.broadcasting_for("all") # => "comments:all"
411
+ #
412
+ # You can pass any object as a target (e.g. Active Record model), and it would
413
+ # be serialized into a string under the hood.
414
+ #
415
+ # source://actioncable//lib/action_cable/channel/broadcasting.rb#24
416
+ def broadcasting_for(model); end
417
+
418
+ private
419
+
420
+ # source://actioncable//lib/action_cable/channel/broadcasting.rb#29
421
+ def serialize_broadcasting(object); end
422
+ end
423
+
424
+ # # Action Cable Channel Callbacks
425
+ #
426
+ # Action Cable Channel provides callback hooks that are invoked during the life
427
+ # cycle of a channel:
428
+ #
429
+ # * [before_subscribe](rdoc-ref:ClassMethods#before_subscribe)
430
+ # * [after_subscribe](rdoc-ref:ClassMethods#after_subscribe) (aliased as
431
+ # [on_subscribe](rdoc-ref:ClassMethods#on_subscribe))
432
+ # * [before_unsubscribe](rdoc-ref:ClassMethods#before_unsubscribe)
433
+ # * [after_unsubscribe](rdoc-ref:ClassMethods#after_unsubscribe) (aliased as
434
+ # [on_unsubscribe](rdoc-ref:ClassMethods#on_unsubscribe))
435
+ #
436
+ #
437
+ # #### Example
438
+ #
439
+ # class ChatChannel < ApplicationCable::Channel
440
+ # after_subscribe :send_welcome_message, unless: :subscription_rejected?
441
+ # after_subscribe :track_subscription
442
+ #
443
+ # private
444
+ # def send_welcome_message
445
+ # broadcast_to(...)
446
+ # end
447
+ #
448
+ # def track_subscription
449
+ # # ...
450
+ # end
451
+ # end
452
+ #
453
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#38
454
+ module ActionCable::Channel::Callbacks
455
+ extend ::ActiveSupport::Concern
456
+ include GeneratedInstanceMethods
457
+ include ::ActiveSupport::Callbacks
458
+
459
+ mixes_in_class_methods GeneratedClassMethods
460
+ mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods
461
+ mixes_in_class_methods ::ActiveSupport::DescendantsTracker
462
+ mixes_in_class_methods ::ActionCable::Channel::Callbacks::ClassMethods
463
+
464
+ module GeneratedClassMethods
465
+ def __callbacks; end
466
+ def __callbacks=(value); end
467
+ end
468
+
469
+ module GeneratedInstanceMethods
470
+ def __callbacks; end
471
+ end
472
+ end
473
+
474
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#47
475
+ module ActionCable::Channel::Callbacks::ClassMethods
476
+ # This callback will be triggered after the Base#subscribed method is called,
477
+ # even if the subscription was rejected with the Base#reject method.
478
+ #
479
+ # To trigger the callback only on successful subscriptions, use the
480
+ # Base#subscription_rejected? method:
481
+ #
482
+ # after_subscribe :my_method, unless: :subscription_rejected?
483
+ #
484
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#60
485
+ def after_subscribe(*methods, &block); end
486
+
487
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#69
488
+ def after_unsubscribe(*methods, &block); end
489
+
490
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#48
491
+ def before_subscribe(*methods, &block); end
492
+
493
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#65
494
+ def before_unsubscribe(*methods, &block); end
495
+
496
+ # This callback will be triggered after the Base#subscribed method is called,
497
+ # even if the subscription was rejected with the Base#reject method.
498
+ #
499
+ # To trigger the callback only on successful subscriptions, use the
500
+ # Base#subscription_rejected? method:
501
+ #
502
+ # after_subscribe :my_method, unless: :subscription_rejected?
503
+ #
504
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#63
505
+ def on_subscribe(*methods, &block); end
506
+
507
+ # source://actioncable//lib/action_cable/channel/callbacks.rb#72
508
+ def on_unsubscribe(*methods, &block); end
509
+ end
510
+
511
+ # # Action Cable Channel Stub
512
+ #
513
+ # Stub `stream_from` to track streams for the channel. Add public aliases for
514
+ # `subscription_confirmation_sent?` and `subscription_rejected?`.
515
+ #
516
+ # source://actioncable//lib/action_cable/channel/test_case.rb#24
517
+ module ActionCable::Channel::ChannelStub
518
+ # @return [Boolean]
519
+ #
520
+ # source://actioncable//lib/action_cable/channel/test_case.rb#25
521
+ def confirmed?; end
522
+
523
+ # @return [Boolean]
524
+ #
525
+ # source://actioncable//lib/action_cable/channel/test_case.rb#29
526
+ def rejected?; end
527
+
528
+ # Make periodic timers no-op
529
+ #
530
+ # source://actioncable//lib/action_cable/channel/test_case.rb#46
531
+ def start_periodic_timers; end
532
+
533
+ # source://actioncable//lib/action_cable/channel/test_case.rb#37
534
+ def stop_all_streams; end
535
+
536
+ # Make periodic timers no-op
537
+ #
538
+ # source://actioncable//lib/action_cable/channel/test_case.rb#47
539
+ def stop_periodic_timers; end
540
+
541
+ # source://actioncable//lib/action_cable/channel/test_case.rb#33
542
+ def stream_from(broadcasting, *_arg1); end
543
+
544
+ # source://actioncable//lib/action_cable/channel/test_case.rb#41
545
+ def streams; end
546
+ end
547
+
548
+ # source://actioncable//lib/action_cable/channel/test_case.rb#50
549
+ class ActionCable::Channel::ConnectionStub
550
+ # @return [ConnectionStub] a new instance of ConnectionStub
551
+ #
552
+ # source://actioncable//lib/action_cable/channel/test_case.rb#55
553
+ def initialize(identifiers = T.unsafe(nil)); end
554
+
555
+ # source://actioncable//lib/action_cable/channel/test_case.rb#53
556
+ def config(*_arg0, **_arg1, &_arg2); end
557
+
558
+ # source://actioncable//lib/action_cable/channel/test_case.rb#72
559
+ def connection_identifier; end
560
+
561
+ # Returns the value of attribute identifiers.
562
+ #
563
+ # source://actioncable//lib/action_cable/channel/test_case.rb#51
564
+ def identifiers; end
565
+
566
+ # Returns the value of attribute logger.
567
+ #
568
+ # source://actioncable//lib/action_cable/channel/test_case.rb#51
569
+ def logger; end
570
+
571
+ # source://actioncable//lib/action_cable/channel/test_case.rb#53
572
+ def pubsub(*_arg0, **_arg1, &_arg2); end
573
+
574
+ # Returns the value of attribute server.
575
+ #
576
+ # source://actioncable//lib/action_cable/channel/test_case.rb#51
577
+ def server; end
578
+
579
+ # Returns the value of attribute subscriptions.
580
+ #
581
+ # source://actioncable//lib/action_cable/channel/test_case.rb#51
582
+ def subscriptions; end
583
+
584
+ # Returns the value of attribute transmissions.
585
+ #
586
+ # source://actioncable//lib/action_cable/channel/test_case.rb#51
587
+ def transmissions; end
588
+
589
+ # source://actioncable//lib/action_cable/channel/test_case.rb#68
590
+ def transmit(cable_message); end
591
+
592
+ private
593
+
594
+ # source://actioncable//lib/action_cable/channel/test_case.rb#77
595
+ def connection_gid(ids); end
596
+ end
597
+
598
+ # source://actioncable//lib/action_cable/channel/naming.rb#7
599
+ module ActionCable::Channel::Naming
600
+ extend ::ActiveSupport::Concern
601
+
602
+ mixes_in_class_methods ::ActionCable::Channel::Naming::ClassMethods
603
+
604
+ # source://actioncable//lib/action_cable/channel/naming.rb#23
605
+ def channel_name; end
606
+ end
607
+
608
+ # source://actioncable//lib/action_cable/channel/naming.rb#10
609
+ module ActionCable::Channel::Naming::ClassMethods
610
+ # Returns the name of the channel, underscored, without the `Channel` ending. If
611
+ # the channel is in a namespace, then the namespaces are represented by single
612
+ # colon separators in the channel name.
613
+ #
614
+ # ChatChannel.channel_name # => 'chat'
615
+ # Chats::AppearancesChannel.channel_name # => 'chats:appearances'
616
+ # FooChats::BarAppearancesChannel.channel_name # => 'foo_chats:bar_appearances'
617
+ #
618
+ # source://actioncable//lib/action_cable/channel/naming.rb#18
619
+ def channel_name; end
620
+ end
621
+
622
+ # source://actioncable//lib/action_cable/channel/test_case.rb#12
623
+ class ActionCable::Channel::NonInferrableChannelError < ::StandardError
624
+ # @return [NonInferrableChannelError] a new instance of NonInferrableChannelError
625
+ #
626
+ # source://actioncable//lib/action_cable/channel/test_case.rb#13
627
+ def initialize(name); end
628
+ end
629
+
630
+ # source://actioncable//lib/action_cable/channel/periodic_timers.rb#7
631
+ module ActionCable::Channel::PeriodicTimers
632
+ extend ::ActiveSupport::Concern
633
+ include GeneratedInstanceMethods
634
+
635
+ mixes_in_class_methods GeneratedClassMethods
636
+ mixes_in_class_methods ::ActionCable::Channel::PeriodicTimers::ClassMethods
637
+
638
+ private
639
+
640
+ # source://actioncable//lib/action_cable/channel/periodic_timers.rb#56
641
+ def active_periodic_timers; end
642
+
643
+ # source://actioncable//lib/action_cable/channel/periodic_timers.rb#66
644
+ def start_periodic_timer(callback, every:); end
645
+
646
+ # source://actioncable//lib/action_cable/channel/periodic_timers.rb#60
647
+ def start_periodic_timers; end
648
+
649
+ # source://actioncable//lib/action_cable/channel/periodic_timers.rb#72
650
+ def stop_periodic_timers; end
651
+
652
+ module GeneratedClassMethods
653
+ def periodic_timers; end
654
+ def periodic_timers=(value); end
655
+ def periodic_timers?; end
656
+ end
657
+
658
+ module GeneratedInstanceMethods
659
+ def periodic_timers=(value); end
660
+ end
661
+ end
662
+
663
+ # source://actioncable//lib/action_cable/channel/periodic_timers.rb#17
664
+ module ActionCable::Channel::PeriodicTimers::ClassMethods
665
+ # Periodically performs a task on the channel, like updating an online user
666
+ # counter, polling a backend for new status messages, sending regular
667
+ # "heartbeat" messages, or doing some internal work and giving progress updates.
668
+ #
669
+ # Pass a method name or lambda argument or provide a block to call. Specify the
670
+ # calling period in seconds using the `every:` keyword argument.
671
+ #
672
+ # periodically :transmit_progress, every: 5.seconds
673
+ #
674
+ # periodically every: 3.minutes do
675
+ # transmit action: :update_count, count: current_count
676
+ # end
677
+ #
678
+ # source://actioncable//lib/action_cable/channel/periodic_timers.rb#31
679
+ def periodically(callback_or_method_name = T.unsafe(nil), every:, &block); end
680
+ end
681
+
682
+ # # Action Cable Channel Streams
683
+ #
684
+ # Streams allow channels to route broadcastings to the subscriber. A
685
+ # broadcasting is, as discussed elsewhere, a pubsub queue where any data placed
686
+ # into it is automatically sent to the clients that are connected at that time.
687
+ # It's purely an online queue, though. If you're not streaming a broadcasting at
688
+ # the very moment it sends out an update, you will not get that update, even if
689
+ # you connect after it has been sent.
690
+ #
691
+ # Most commonly, the streamed broadcast is sent straight to the subscriber on
692
+ # the client-side. The channel just acts as a connector between the two parties
693
+ # (the broadcaster and the channel subscriber). Here's an example of a channel
694
+ # that allows subscribers to get all new comments on a given page:
695
+ #
696
+ # class CommentsChannel < ApplicationCable::Channel
697
+ # def follow(data)
698
+ # stream_from "comments_for_#{data['recording_id']}"
699
+ # end
700
+ #
701
+ # def unfollow
702
+ # stop_all_streams
703
+ # end
704
+ # end
705
+ #
706
+ # Based on the above example, the subscribers of this channel will get whatever
707
+ # data is put into the, let's say, `comments_for_45` broadcasting as soon as
708
+ # it's put there.
709
+ #
710
+ # An example broadcasting for this channel looks like so:
711
+ #
712
+ # ActionCable.server.broadcast "comments_for_45", { author: 'DHH', content: 'Rails is just swell' }
713
+ #
714
+ # If you have a stream that is related to a model, then the broadcasting used
715
+ # can be generated from the model and channel. The following example would
716
+ # subscribe to a broadcasting like `comments:Z2lkOi8vVGVzdEFwcC9Qb3N0LzE`.
717
+ #
718
+ # class CommentsChannel < ApplicationCable::Channel
719
+ # def subscribed
720
+ # post = Post.find(params[:id])
721
+ # stream_for post
722
+ # end
723
+ # end
724
+ #
725
+ # You can then broadcast to this channel using:
726
+ #
727
+ # CommentsChannel.broadcast_to(@post, @comment)
728
+ #
729
+ # If you don't just want to parlay the broadcast unfiltered to the subscriber,
730
+ # you can also supply a callback that lets you alter what is sent out. The below
731
+ # example shows how you can use this to provide performance introspection in the
732
+ # process:
733
+ #
734
+ # class ChatChannel < ApplicationCable::Channel
735
+ # def subscribed
736
+ # @room = Chat::Room[params[:room_number]]
737
+ #
738
+ # stream_for @room, coder: ActiveSupport::JSON do |message|
739
+ # if message['originated_at'].present?
740
+ # elapsed_time = (Time.now.to_f - message['originated_at']).round(2)
741
+ #
742
+ # ActiveSupport::Notifications.instrument :performance, measurement: 'Chat.message_delay', value: elapsed_time, action: :timing
743
+ # logger.info "Message took #{elapsed_time}s to arrive"
744
+ # end
745
+ #
746
+ # transmit message
747
+ # end
748
+ # end
749
+ # end
750
+ #
751
+ # You can stop streaming from all broadcasts by calling #stop_all_streams.
752
+ #
753
+ # source://actioncable//lib/action_cable/channel/streams.rb#77
754
+ module ActionCable::Channel::Streams
755
+ extend ::ActiveSupport::Concern
756
+
757
+ # source://actioncable//lib/action_cable/channel/streams.rb#153
758
+ def pubsub(*_arg0, **_arg1, &_arg2); end
759
+
760
+ # Unsubscribes all streams associated with this channel from the pubsub queue.
761
+ #
762
+ # source://actioncable//lib/action_cable/channel/streams.rb#135
763
+ def stop_all_streams; end
764
+
765
+ # Unsubscribes streams for the `model`.
766
+ #
767
+ # source://actioncable//lib/action_cable/channel/streams.rb#130
768
+ def stop_stream_for(model); end
769
+
770
+ # Unsubscribes streams from the named `broadcasting`.
771
+ #
772
+ # source://actioncable//lib/action_cable/channel/streams.rb#121
773
+ def stop_stream_from(broadcasting); end
774
+
775
+ # Start streaming the pubsub queue for the `model` in this channel. Optionally,
776
+ # you can pass a `callback` that'll be used instead of the default of just
777
+ # transmitting the updates straight to the subscriber.
778
+ #
779
+ # Pass `coder: ActiveSupport::JSON` to decode messages as JSON before passing to
780
+ # the callback. Defaults to `coder: nil` which does no decoding, passes raw
781
+ # messages.
782
+ #
783
+ # source://actioncable//lib/action_cable/channel/streams.rb#116
784
+ def stream_for(model, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end
785
+
786
+ # Start streaming from the named `broadcasting` pubsub queue. Optionally, you
787
+ # can pass a `callback` that'll be used instead of the default of just
788
+ # transmitting the updates straight to the subscriber. Pass `coder:
789
+ # ActiveSupport::JSON` to decode messages as JSON before passing to the
790
+ # callback. Defaults to `coder: nil` which does no decoding, passes raw
791
+ # messages.
792
+ #
793
+ # source://actioncable//lib/action_cable/channel/streams.rb#90
794
+ def stream_from(broadcasting, callback = T.unsafe(nil), coder: T.unsafe(nil), &block); end
795
+
796
+ # Calls stream_for with the given `model` if it's present to start streaming,
797
+ # otherwise rejects the subscription.
798
+ #
799
+ # source://actioncable//lib/action_cable/channel/streams.rb#144
800
+ def stream_or_reject_for(model); end
801
+
802
+ private
803
+
804
+ # May be overridden to change the default stream handling behavior which decodes
805
+ # JSON and transmits to the client.
806
+ #
807
+ # TODO: Tests demonstrating this.
808
+ #
809
+ # TODO: Room for optimization. Update transmit API to be coder-aware so we can
810
+ # no-op when pubsub and connection are both JSON-encoded. Then we can skip
811
+ # decode+encode if we're just proxying messages.
812
+ #
813
+ # source://actioncable//lib/action_cable/channel/streams.rb#189
814
+ def default_stream_handler(broadcasting, coder:); end
815
+
816
+ # source://actioncable//lib/action_cable/channel/streams.rb#210
817
+ def identity_handler; end
818
+
819
+ # source://actioncable//lib/action_cable/channel/streams.rb#194
820
+ def stream_decoder(handler = T.unsafe(nil), coder:); end
821
+
822
+ # May be overridden to add instrumentation, logging, specialized error handling,
823
+ # or other forms of handler decoration.
824
+ #
825
+ # TODO: Tests demonstrating this.
826
+ #
827
+ # source://actioncable//lib/action_cable/channel/streams.rb#173
828
+ def stream_handler(broadcasting, user_handler, coder: T.unsafe(nil)); end
829
+
830
+ # source://actioncable//lib/action_cable/channel/streams.rb#202
831
+ def stream_transmitter(handler = T.unsafe(nil), broadcasting:); end
832
+
833
+ # source://actioncable//lib/action_cable/channel/streams.rb#155
834
+ def streams; end
835
+
836
+ # Always wrap the outermost handler to invoke the user handler on the worker
837
+ # pool rather than blocking the event loop.
838
+ #
839
+ # source://actioncable//lib/action_cable/channel/streams.rb#161
840
+ def worker_pool_stream_handler(broadcasting, user_handler, coder: T.unsafe(nil)); end
841
+ end
842
+
843
+ # Superclass for Action Cable channel functional tests.
844
+ #
845
+ # ## Basic example
846
+ #
847
+ # Functional tests are written as follows:
848
+ # 1. First, one uses the `subscribe` method to simulate subscription creation.
849
+ # 2. Then, one asserts whether the current state is as expected. "State" can be
850
+ # anything: transmitted messages, subscribed streams, etc.
851
+ #
852
+ #
853
+ # For example:
854
+ #
855
+ # class ChatChannelTest < ActionCable::Channel::TestCase
856
+ # def test_subscribed_with_room_number
857
+ # # Simulate a subscription creation
858
+ # subscribe room_number: 1
859
+ #
860
+ # # Asserts that the subscription was successfully created
861
+ # assert subscription.confirmed?
862
+ #
863
+ # # Asserts that the channel subscribes connection to a stream
864
+ # assert_has_stream "chat_1"
865
+ #
866
+ # # Asserts that the channel subscribes connection to a specific
867
+ # # stream created for a model
868
+ # assert_has_stream_for Room.find(1)
869
+ # end
870
+ #
871
+ # def test_does_not_stream_with_incorrect_room_number
872
+ # subscribe room_number: -1
873
+ #
874
+ # # Asserts that not streams was started
875
+ # assert_no_streams
876
+ # end
877
+ #
878
+ # def test_does_not_subscribe_without_room_number
879
+ # subscribe
880
+ #
881
+ # # Asserts that the subscription was rejected
882
+ # assert subscription.rejected?
883
+ # end
884
+ # end
885
+ #
886
+ # You can also perform actions:
887
+ # def test_perform_speak
888
+ # subscribe room_number: 1
889
+ #
890
+ # perform :speak, message: "Hello, Rails!"
891
+ #
892
+ # assert_equal "Hello, Rails!", transmissions.last["text"]
893
+ # end
894
+ #
895
+ # ## Special methods
896
+ #
897
+ # ActionCable::Channel::TestCase will also automatically provide the following
898
+ # instance methods for use in the tests:
899
+ #
900
+ # connection
901
+ # connection.
902
+ #
903
+ # subscription
904
+ #
905
+ # transmissions
906
+ #
907
+ #
908
+ # ## Channel is automatically inferred
909
+ #
910
+ # ActionCable::Channel::TestCase will automatically infer the channel under test
911
+ # from the test class name. If the channel cannot be inferred from the test
912
+ # class name, you can explicitly set it with `tests`.
913
+ #
914
+ # class SpecialEdgeCaseChannelTest < ActionCable::Channel::TestCase
915
+ # tests SpecialChannel
916
+ # end
917
+ #
918
+ # ## Specifying connection identifiers
919
+ #
920
+ # You need to set up your connection manually to provide values for the
921
+ # identifiers. To do this just use:
922
+ #
923
+ # stub_connection(user: users(:john))
924
+ #
925
+ # ## Testing broadcasting
926
+ #
927
+ # ActionCable::Channel::TestCase enhances ActionCable::TestHelper assertions
928
+ # (e.g. `assert_broadcasts`) to handle broadcasting to models:
929
+ #
930
+ # # in your channel
931
+ # def speak(data)
932
+ # broadcast_to room, text: data["message"]
933
+ # end
934
+ #
935
+ # def test_speak
936
+ # subscribe room_id: rooms(:chat).id
937
+ #
938
+ # assert_broadcast_on(rooms(:chat), text: "Hello, Rails!") do
939
+ # perform :speak, message: "Hello, Rails!"
940
+ # end
941
+ # end
942
+ #
943
+ # source://actioncable//lib/action_cable/channel/test_case.rb#190
944
+ class ActionCable::Channel::TestCase < ::ActiveSupport::TestCase
945
+ include ::ActiveSupport::Testing::ConstantLookup
946
+ include ::ActionCable::TestHelper
947
+ include ::ActionCable::Channel::TestCase::Behavior
948
+ extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods
949
+ extend ::ActionCable::Channel::TestCase::Behavior::ClassMethods
950
+
951
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
952
+ def _channel_class; end
953
+
954
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
955
+ def _channel_class=(_arg0); end
956
+
957
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
958
+ def _channel_class?; end
959
+
960
+ # source://actioncable//lib/action_cable/channel/test_case.rb#202
961
+ def connection; end
962
+
963
+ # source://actioncable//lib/action_cable/channel/test_case.rb#202
964
+ def subscription; end
965
+
966
+ class << self
967
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
968
+ def _channel_class; end
969
+
970
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
971
+ def _channel_class=(value); end
972
+
973
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
974
+ def _channel_class?; end
975
+
976
+ private
977
+
978
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
979
+ def __class_attr__channel_class; end
980
+
981
+ # source://actioncable//lib/action_cable/channel/test_case.rb#200
982
+ def __class_attr__channel_class=(new_value); end
983
+ end
984
+ end
985
+
986
+ # source://actioncable//lib/action_cable/channel/test_case.rb#191
987
+ module ActionCable::Channel::TestCase::Behavior
988
+ include ::ActionCable::TestHelper
989
+ extend ::ActiveSupport::Concern
990
+ include GeneratedInstanceMethods
991
+ include ::ActiveSupport::Testing::ConstantLookup
992
+
993
+ mixes_in_class_methods GeneratedClassMethods
994
+ mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods
995
+ mixes_in_class_methods ::ActionCable::Channel::TestCase::Behavior::ClassMethods
996
+
997
+ # source://actioncable//lib/action_cable/channel/test_case.rb#282
998
+ def assert_broadcast_on(stream_or_object, *args); end
999
+
1000
+ # Enhance TestHelper assertions to handle non-String broadcastings
1001
+ #
1002
+ # source://actioncable//lib/action_cable/channel/test_case.rb#278
1003
+ def assert_broadcasts(stream_or_object, *args); end
1004
+
1005
+ # Asserts that the specified stream has not been started.
1006
+ #
1007
+ # def test_assert_no_started_stream
1008
+ # subscribe
1009
+ # assert_has_no_stream 'messages'
1010
+ # end
1011
+ #
1012
+ # source://actioncable//lib/action_cable/channel/test_case.rb#326
1013
+ def assert_has_no_stream(stream); end
1014
+
1015
+ # Asserts that the specified stream for a model has not started.
1016
+ #
1017
+ # def test_assert_no_started_stream_for
1018
+ # subscribe id: 41
1019
+ # assert_has_no_stream_for User.find(42)
1020
+ # end
1021
+ #
1022
+ # source://actioncable//lib/action_cable/channel/test_case.rb#337
1023
+ def assert_has_no_stream_for(object); end
1024
+
1025
+ # Asserts that the specified stream has been started.
1026
+ #
1027
+ # def test_assert_started_stream
1028
+ # subscribe
1029
+ # assert_has_stream 'messages'
1030
+ # end
1031
+ #
1032
+ # source://actioncable//lib/action_cable/channel/test_case.rb#304
1033
+ def assert_has_stream(stream); end
1034
+
1035
+ # Asserts that the specified stream for a model has started.
1036
+ #
1037
+ # def test_assert_started_stream_for
1038
+ # subscribe id: 42
1039
+ # assert_has_stream_for User.find(42)
1040
+ # end
1041
+ #
1042
+ # source://actioncable//lib/action_cable/channel/test_case.rb#315
1043
+ def assert_has_stream_for(object); end
1044
+
1045
+ # Asserts that no streams have been started.
1046
+ #
1047
+ # def test_assert_no_started_stream
1048
+ # subscribe
1049
+ # assert_no_streams
1050
+ # end
1051
+ #
1052
+ # source://actioncable//lib/action_cable/channel/test_case.rb#293
1053
+ def assert_no_streams; end
1054
+
1055
+ # Perform action on a channel.
1056
+ #
1057
+ # NOTE: Must be subscribed.
1058
+ #
1059
+ # source://actioncable//lib/action_cable/channel/test_case.rb#266
1060
+ def perform(action, data = T.unsafe(nil)); end
1061
+
1062
+ # Set up test connection with the specified identifiers:
1063
+ #
1064
+ # class ApplicationCable < ActionCable::Connection::Base
1065
+ # identified_by :user, :token
1066
+ # end
1067
+ #
1068
+ # stub_connection(user: users[:john], token: 'my-secret-token')
1069
+ #
1070
+ # source://actioncable//lib/action_cable/channel/test_case.rb#243
1071
+ def stub_connection(identifiers = T.unsafe(nil)); end
1072
+
1073
+ # Subscribe to the channel under test. Optionally pass subscription parameters
1074
+ # as a Hash.
1075
+ #
1076
+ # source://actioncable//lib/action_cable/channel/test_case.rb#249
1077
+ def subscribe(params = T.unsafe(nil)); end
1078
+
1079
+ # Returns messages transmitted into channel
1080
+ #
1081
+ # source://actioncable//lib/action_cable/channel/test_case.rb#272
1082
+ def transmissions; end
1083
+
1084
+ # Unsubscribe the subscription under test.
1085
+ #
1086
+ # source://actioncable//lib/action_cable/channel/test_case.rb#258
1087
+ def unsubscribe; end
1088
+
1089
+ private
1090
+
1091
+ # source://actioncable//lib/action_cable/channel/test_case.rb#346
1092
+ def broadcasting_for(stream_or_object); end
1093
+
1094
+ # source://actioncable//lib/action_cable/channel/test_case.rb#342
1095
+ def check_subscribed!; end
1096
+
1097
+ module GeneratedClassMethods
1098
+ def _channel_class; end
1099
+ def _channel_class=(value); end
1100
+ def _channel_class?; end
1101
+ end
1102
+
1103
+ module GeneratedInstanceMethods
1104
+ def _channel_class; end
1105
+ def _channel_class=(value); end
1106
+ def _channel_class?; end
1107
+ end
1108
+ end
1109
+
1110
+ # source://actioncable//lib/action_cable/channel/test_case.rb#197
1111
+ ActionCable::Channel::TestCase::Behavior::CHANNEL_IDENTIFIER = T.let(T.unsafe(nil), String)
1112
+
1113
+ # source://actioncable//lib/action_cable/channel/test_case.rb#207
1114
+ module ActionCable::Channel::TestCase::Behavior::ClassMethods
1115
+ # source://actioncable//lib/action_cable/channel/test_case.rb#219
1116
+ def channel_class; end
1117
+
1118
+ # @raise [NonInferrableChannelError]
1119
+ #
1120
+ # source://actioncable//lib/action_cable/channel/test_case.rb#227
1121
+ def determine_default_channel(name); end
1122
+
1123
+ # source://actioncable//lib/action_cable/channel/test_case.rb#208
1124
+ def tests(channel); end
1125
+ end
1126
+
1127
+ # source://actioncable//lib/action_cable/connection/identification.rb#6
1128
+ module ActionCable::Connection; end
1129
+
1130
+ # source://actioncable//lib/action_cable/connection/test_case.rb#22
1131
+ module ActionCable::Connection::Assertions
1132
+ # Asserts that the connection is rejected (via
1133
+ # `reject_unauthorized_connection`).
1134
+ #
1135
+ # # Asserts that connection without user_id fails
1136
+ # assert_reject_connection { connect params: { user_id: '' } }
1137
+ #
1138
+ # source://actioncable//lib/action_cable/connection/test_case.rb#28
1139
+ def assert_reject_connection(&block); end
1140
+ end
1141
+
1142
+ # source://actioncable//lib/action_cable/connection/authorization.rb#7
1143
+ module ActionCable::Connection::Authorization
1144
+ # Closes the WebSocket connection if it is open and returns an "unauthorized"
1145
+ # reason.
1146
+ #
1147
+ # @raise [UnauthorizedError]
1148
+ #
1149
+ # source://actioncable//lib/action_cable/connection/authorization.rb#12
1150
+ def reject_unauthorized_connection; end
1151
+ end
1152
+
1153
+ # source://actioncable//lib/action_cable/connection/authorization.rb#8
1154
+ class ActionCable::Connection::Authorization::UnauthorizedError < ::StandardError; end
1155
+
1156
+ # # Action Cable Connection Base
1157
+ #
1158
+ # For every WebSocket connection the Action Cable server accepts, a Connection
1159
+ # object will be instantiated. This instance becomes the parent of all of the
1160
+ # channel subscriptions that are created from there on. Incoming messages are
1161
+ # then routed to these channel subscriptions based on an identifier sent by the
1162
+ # Action Cable consumer. The Connection itself does not deal with any specific
1163
+ # application logic beyond authentication and authorization.
1164
+ #
1165
+ # Here's a basic example:
1166
+ #
1167
+ # module ApplicationCable
1168
+ # class Connection < ActionCable::Connection::Base
1169
+ # identified_by :current_user
1170
+ #
1171
+ # def connect
1172
+ # self.current_user = find_verified_user
1173
+ # logger.add_tags current_user.name
1174
+ # end
1175
+ #
1176
+ # def disconnect
1177
+ # # Any cleanup work needed when the cable connection is cut.
1178
+ # end
1179
+ #
1180
+ # private
1181
+ # def find_verified_user
1182
+ # User.find_by_identity(cookies.encrypted[:identity_id]) ||
1183
+ # reject_unauthorized_connection
1184
+ # end
1185
+ # end
1186
+ # end
1187
+ #
1188
+ # First, we declare that this connection can be identified by its current_user.
1189
+ # This allows us to later be able to find all connections established for that
1190
+ # current_user (and potentially disconnect them). You can declare as many
1191
+ # identification indexes as you like. Declaring an identification means that an
1192
+ # attr_accessor is automatically set for that key.
1193
+ #
1194
+ # Second, we rely on the fact that the WebSocket connection is established with
1195
+ # the cookies from the domain being sent along. This makes it easy to use signed
1196
+ # cookies that were set when logging in via a web interface to authorize the
1197
+ # WebSocket connection.
1198
+ #
1199
+ # Finally, we add a tag to the connection-specific logger with the name of the
1200
+ # current user to easily distinguish their messages in the log.
1201
+ #
1202
+ # Pretty simple, eh?
1203
+ #
1204
+ # source://actioncable//lib/action_cable/connection/base.rb#57
1205
+ class ActionCable::Connection::Base
1206
+ include ::ActionCable::Connection::Identification
1207
+ include ::ActionCable::Connection::InternalChannel
1208
+ include ::ActionCable::Connection::Authorization
1209
+ include ::ActiveSupport::Callbacks
1210
+ include ::ActionCable::Connection::Callbacks
1211
+ include ::ActiveSupport::Rescuable
1212
+ extend ::ActionCable::Connection::Identification::ClassMethods
1213
+ extend ::ActiveSupport::Callbacks::ClassMethods
1214
+ extend ::ActiveSupport::DescendantsTracker
1215
+ extend ::ActionCable::Connection::Callbacks::ClassMethods
1216
+ extend ::ActiveSupport::Rescuable::ClassMethods
1217
+
1218
+ # @return [Base] a new instance of Base
1219
+ #
1220
+ # source://actioncable//lib/action_cable/connection/base.rb#67
1221
+ def initialize(server, env, coder: T.unsafe(nil)); end
1222
+
1223
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1224
+ def __callbacks; end
1225
+
1226
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1227
+ def _command_callbacks; end
1228
+
1229
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1230
+ def _run_command_callbacks(&block); end
1231
+
1232
+ # source://actioncable//lib/action_cable/connection/base.rb#147
1233
+ def beat; end
1234
+
1235
+ # Close the WebSocket connection.
1236
+ #
1237
+ # source://actioncable//lib/action_cable/connection/base.rb#120
1238
+ def close(reason: T.unsafe(nil), reconnect: T.unsafe(nil)); end
1239
+
1240
+ # source://actioncable//lib/action_cable/connection/base.rb#65
1241
+ def config(*_arg0, **_arg1, &_arg2); end
1242
+
1243
+ # source://actioncable//lib/action_cable/connection/base.rb#101
1244
+ def dispatch_websocket_message(websocket_message); end
1245
+
1246
+ # Returns the value of attribute env.
1247
+ #
1248
+ # source://actioncable//lib/action_cable/connection/base.rb#64
1249
+ def env; end
1250
+
1251
+ # source://actioncable//lib/action_cable/connection/base.rb#65
1252
+ def event_loop(*_arg0, **_arg1, &_arg2); end
1253
+
1254
+ # source://actioncable//lib/action_cable/connection/base.rb#109
1255
+ def handle_channel_command(payload); end
1256
+
1257
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1258
+ def identifiers; end
1259
+
1260
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1261
+ def identifiers=(_arg0); end
1262
+
1263
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1264
+ def identifiers?; end
1265
+
1266
+ # source://actioncable//lib/action_cable/connection/base.rb#168
1267
+ def inspect; end
1268
+
1269
+ # Returns the value of attribute logger.
1270
+ #
1271
+ # source://actioncable//lib/action_cable/connection/base.rb#64
1272
+ def logger; end
1273
+
1274
+ # source://actioncable//lib/action_cable/connection/base.rb#164
1275
+ def on_close(reason, code); end
1276
+
1277
+ # source://actioncable//lib/action_cable/connection/base.rb#159
1278
+ def on_error(message); end
1279
+
1280
+ # source://actioncable//lib/action_cable/connection/base.rb#155
1281
+ def on_message(message); end
1282
+
1283
+ # source://actioncable//lib/action_cable/connection/base.rb#151
1284
+ def on_open; end
1285
+
1286
+ # Called by the server when a new WebSocket connection is established. This
1287
+ # configures the callbacks intended for overwriting by the user. This method
1288
+ # should not be called directly -- instead rely upon on the #connect (and
1289
+ # #disconnect) callbacks.
1290
+ #
1291
+ # source://actioncable//lib/action_cable/connection/base.rb#85
1292
+ def process; end
1293
+
1294
+ # Returns the value of attribute protocol.
1295
+ #
1296
+ # source://actioncable//lib/action_cable/connection/base.rb#64
1297
+ def protocol; end
1298
+
1299
+ # source://actioncable//lib/action_cable/connection/base.rb#65
1300
+ def pubsub(*_arg0, **_arg1, &_arg2); end
1301
+
1302
+ # Decodes WebSocket messages and dispatches them to subscribed channels.
1303
+ # WebSocket message transfer encoding is always JSON.
1304
+ #
1305
+ # source://actioncable//lib/action_cable/connection/base.rb#97
1306
+ def receive(websocket_message); end
1307
+
1308
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1309
+ def rescue_handlers; end
1310
+
1311
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1312
+ def rescue_handlers=(_arg0); end
1313
+
1314
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1315
+ def rescue_handlers?; end
1316
+
1317
+ # Invoke a method on the connection asynchronously through the pool of thread
1318
+ # workers.
1319
+ #
1320
+ # source://actioncable//lib/action_cable/connection/base.rb#131
1321
+ def send_async(method, *arguments); end
1322
+
1323
+ # Returns the value of attribute server.
1324
+ #
1325
+ # source://actioncable//lib/action_cable/connection/base.rb#64
1326
+ def server; end
1327
+
1328
+ # Return a basic hash of statistics for the connection keyed with `identifier`,
1329
+ # `started_at`, `subscriptions`, and `request_id`. This can be returned by a
1330
+ # health check against the connection.
1331
+ #
1332
+ # source://actioncable//lib/action_cable/connection/base.rb#138
1333
+ def statistics; end
1334
+
1335
+ # Returns the value of attribute subscriptions.
1336
+ #
1337
+ # source://actioncable//lib/action_cable/connection/base.rb#64
1338
+ def subscriptions; end
1339
+
1340
+ # source://actioncable//lib/action_cable/connection/base.rb#115
1341
+ def transmit(cable_message); end
1342
+
1343
+ # Returns the value of attribute worker_pool.
1344
+ #
1345
+ # source://actioncable//lib/action_cable/connection/base.rb#64
1346
+ def worker_pool; end
1347
+
1348
+ private
1349
+
1350
+ # @return [Boolean]
1351
+ #
1352
+ # source://actioncable//lib/action_cable/connection/base.rb#228
1353
+ def allow_request_origin?; end
1354
+
1355
+ # The cookies of the request that initiated the WebSocket connection. Useful for
1356
+ # performing authorization checks.
1357
+ #
1358
+ # source://actioncable//lib/action_cable/connection/base.rb#187
1359
+ def cookies; end
1360
+
1361
+ # source://actioncable//lib/action_cable/connection/base.rb#195
1362
+ def decode(websocket_message); end
1363
+
1364
+ # source://actioncable//lib/action_cable/connection/base.rb#191
1365
+ def encode(cable_message); end
1366
+
1367
+ # source://actioncable//lib/action_cable/connection/base.rb#271
1368
+ def finished_request_message; end
1369
+
1370
+ # source://actioncable//lib/action_cable/connection/base.rb#211
1371
+ def handle_close; end
1372
+
1373
+ # source://actioncable//lib/action_cable/connection/base.rb#199
1374
+ def handle_open; end
1375
+
1376
+ # source://actioncable//lib/action_cable/connection/base.rb#279
1377
+ def invalid_request_message; end
1378
+
1379
+ # Returns the value of attribute message_buffer.
1380
+ #
1381
+ # source://actioncable//lib/action_cable/connection/base.rb#174
1382
+ def message_buffer; end
1383
+
1384
+ # Tags are declared in the server but computed in the connection. This allows us
1385
+ # per-connection tailored tags.
1386
+ #
1387
+ # source://actioncable//lib/action_cable/connection/base.rb#257
1388
+ def new_tagged_logger; end
1389
+
1390
+ # The request that initiated the WebSocket connection is available here. This
1391
+ # gives access to the environment, cookies, etc.
1392
+ #
1393
+ # source://actioncable//lib/action_cable/connection/base.rb#178
1394
+ def request; end
1395
+
1396
+ # source://actioncable//lib/action_cable/connection/base.rb#247
1397
+ def respond_to_invalid_request; end
1398
+
1399
+ # source://actioncable//lib/action_cable/connection/base.rb#242
1400
+ def respond_to_successful_request; end
1401
+
1402
+ # source://actioncable//lib/action_cable/connection/base.rb#222
1403
+ def send_welcome_message; end
1404
+
1405
+ # source://actioncable//lib/action_cable/connection/base.rb#262
1406
+ def started_request_message; end
1407
+
1408
+ # source://actioncable//lib/action_cable/connection/base.rb#285
1409
+ def successful_request_message; end
1410
+
1411
+ # Returns the value of attribute websocket.
1412
+ #
1413
+ # source://actioncable//lib/action_cable/connection/base.rb#173
1414
+ def websocket; end
1415
+
1416
+ class << self
1417
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1418
+ def __callbacks; end
1419
+
1420
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1421
+ def __callbacks=(value); end
1422
+
1423
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1424
+ def _command_callbacks; end
1425
+
1426
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1427
+ def _command_callbacks=(value); end
1428
+
1429
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1430
+ def identifiers; end
1431
+
1432
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1433
+ def identifiers=(value); end
1434
+
1435
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1436
+ def identifiers?; end
1437
+
1438
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1439
+ def rescue_handlers; end
1440
+
1441
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1442
+ def rescue_handlers=(value); end
1443
+
1444
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1445
+ def rescue_handlers?; end
1446
+
1447
+ private
1448
+
1449
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1450
+ def __class_attr___callbacks; end
1451
+
1452
+ # source://actioncable//lib/action_cable/connection/base.rb#61
1453
+ def __class_attr___callbacks=(new_value); end
1454
+
1455
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1456
+ def __class_attr_identifiers; end
1457
+
1458
+ # source://actioncable//lib/action_cable/connection/base.rb#58
1459
+ def __class_attr_identifiers=(new_value); end
1460
+
1461
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1462
+ def __class_attr_rescue_handlers; end
1463
+
1464
+ # source://actioncable//lib/action_cable/connection/base.rb#62
1465
+ def __class_attr_rescue_handlers=(new_value); end
1466
+ end
1467
+ end
1468
+
1469
+ # # Action Cable Connection Callbacks
1470
+ #
1471
+ # The [before_command](rdoc-ref:ClassMethods#before_command),
1472
+ # [after_command](rdoc-ref:ClassMethods#after_command), and
1473
+ # [around_command](rdoc-ref:ClassMethods#around_command) callbacks are invoked
1474
+ # when sending commands to the client, such as when subscribing, unsubscribing,
1475
+ # or performing an action.
1476
+ #
1477
+ # #### Example
1478
+ #
1479
+ # module ApplicationCable
1480
+ # class Connection < ActionCable::Connection::Base
1481
+ # identified_by :user
1482
+ #
1483
+ # around_command :set_current_account
1484
+ #
1485
+ # private
1486
+ #
1487
+ # def set_current_account
1488
+ # # Now all channels could use Current.account
1489
+ # Current.set(account: user.account) { yield }
1490
+ # end
1491
+ # end
1492
+ # end
1493
+ #
1494
+ # source://actioncable//lib/action_cable/connection/callbacks.rb#34
1495
+ module ActionCable::Connection::Callbacks
1496
+ extend ::ActiveSupport::Concern
1497
+ include GeneratedInstanceMethods
1498
+ include ::ActiveSupport::Callbacks
1499
+
1500
+ mixes_in_class_methods GeneratedClassMethods
1501
+ mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods
1502
+ mixes_in_class_methods ::ActiveSupport::DescendantsTracker
1503
+ mixes_in_class_methods ::ActionCable::Connection::Callbacks::ClassMethods
1504
+
1505
+ module GeneratedClassMethods
1506
+ def __callbacks; end
1507
+ def __callbacks=(value); end
1508
+ end
1509
+
1510
+ module GeneratedInstanceMethods
1511
+ def __callbacks; end
1512
+ end
1513
+ end
1514
+
1515
+ # source://actioncable//lib/action_cable/connection/callbacks.rb#42
1516
+ module ActionCable::Connection::Callbacks::ClassMethods
1517
+ # source://actioncable//lib/action_cable/connection/callbacks.rb#47
1518
+ def after_command(*methods, &block); end
1519
+
1520
+ # source://actioncable//lib/action_cable/connection/callbacks.rb#51
1521
+ def around_command(*methods, &block); end
1522
+
1523
+ # source://actioncable//lib/action_cable/connection/callbacks.rb#43
1524
+ def before_command(*methods, &block); end
1525
+ end
1526
+
1527
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#13
1528
+ class ActionCable::Connection::ClientSocket
1529
+ # @return [ClientSocket] a new instance of ClientSocket
1530
+ #
1531
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#36
1532
+ def initialize(env, event_target, event_loop, protocols); end
1533
+
1534
+ # @return [Boolean]
1535
+ #
1536
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#114
1537
+ def alive?; end
1538
+
1539
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#110
1540
+ def client_gone; end
1541
+
1542
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#92
1543
+ def close(code = T.unsafe(nil), reason = T.unsafe(nil)); end
1544
+
1545
+ # Returns the value of attribute env.
1546
+ #
1547
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#34
1548
+ def env; end
1549
+
1550
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#106
1551
+ def parse(data); end
1552
+
1553
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#118
1554
+ def protocol; end
1555
+
1556
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#71
1557
+ def rack_response; end
1558
+
1559
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#59
1560
+ def start_driver; end
1561
+
1562
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#82
1563
+ def transmit(message); end
1564
+
1565
+ # Returns the value of attribute url.
1566
+ #
1567
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#34
1568
+ def url; end
1569
+
1570
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#76
1571
+ def write(data); end
1572
+
1573
+ private
1574
+
1575
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#142
1576
+ def begin_close(reason, code); end
1577
+
1578
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#136
1579
+ def emit_error(message); end
1580
+
1581
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#151
1582
+ def finalize_close; end
1583
+
1584
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#123
1585
+ def open; end
1586
+
1587
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#130
1588
+ def receive_message(data); end
1589
+
1590
+ class << self
1591
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#14
1592
+ def determine_url(env); end
1593
+
1594
+ # @return [Boolean]
1595
+ #
1596
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#19
1597
+ def secure_request?(env); end
1598
+ end
1599
+ end
1600
+
1601
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#32
1602
+ ActionCable::Connection::ClientSocket::CLOSED = T.let(T.unsafe(nil), Integer)
1603
+
1604
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#31
1605
+ ActionCable::Connection::ClientSocket::CLOSING = T.let(T.unsafe(nil), Integer)
1606
+
1607
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#29
1608
+ ActionCable::Connection::ClientSocket::CONNECTING = T.let(T.unsafe(nil), Integer)
1609
+
1610
+ # source://actioncable//lib/action_cable/connection/client_socket.rb#30
1611
+ ActionCable::Connection::ClientSocket::OPEN = T.let(T.unsafe(nil), Integer)
1612
+
1613
+ # source://actioncable//lib/action_cable/connection/identification.rb#7
1614
+ module ActionCable::Connection::Identification
1615
+ extend ::ActiveSupport::Concern
1616
+ include GeneratedInstanceMethods
1617
+
1618
+ mixes_in_class_methods GeneratedClassMethods
1619
+ mixes_in_class_methods ::ActionCable::Connection::Identification::ClassMethods
1620
+
1621
+ # Return a single connection identifier that combines the value of all the
1622
+ # registered identifiers into a single gid.
1623
+ #
1624
+ # source://actioncable//lib/action_cable/connection/identification.rb#29
1625
+ def connection_identifier; end
1626
+
1627
+ private
1628
+
1629
+ # source://actioncable//lib/action_cable/connection/identification.rb#38
1630
+ def connection_gid(ids); end
1631
+
1632
+ module GeneratedClassMethods
1633
+ def identifiers; end
1634
+ def identifiers=(value); end
1635
+ def identifiers?; end
1636
+ end
1637
+
1638
+ module GeneratedInstanceMethods
1639
+ def identifiers; end
1640
+ def identifiers=(value); end
1641
+ def identifiers?; end
1642
+ end
1643
+ end
1644
+
1645
+ # source://actioncable//lib/action_cable/connection/identification.rb#14
1646
+ module ActionCable::Connection::Identification::ClassMethods
1647
+ # Mark a key as being a connection identifier index that can then be used to
1648
+ # find the specific connection again later. Common identifiers are current_user
1649
+ # and current_account, but could be anything, really.
1650
+ #
1651
+ # Note that anything marked as an identifier will automatically create a
1652
+ # delegate by the same name on any channel instances created off the connection.
1653
+ #
1654
+ # source://actioncable//lib/action_cable/connection/identification.rb#21
1655
+ def identified_by(*identifiers); end
1656
+ end
1657
+
1658
+ # # Action Cable InternalChannel
1659
+ #
1660
+ # Makes it possible for the RemoteConnection to disconnect a specific
1661
+ # connection.
1662
+ #
1663
+ # source://actioncable//lib/action_cable/connection/internal_channel.rb#11
1664
+ module ActionCable::Connection::InternalChannel
1665
+ extend ::ActiveSupport::Concern
1666
+
1667
+ private
1668
+
1669
+ # source://actioncable//lib/action_cable/connection/internal_channel.rb#15
1670
+ def internal_channel; end
1671
+
1672
+ # source://actioncable//lib/action_cable/connection/internal_channel.rb#36
1673
+ def process_internal_message(message); end
1674
+
1675
+ # source://actioncable//lib/action_cable/connection/internal_channel.rb#19
1676
+ def subscribe_to_internal_channel; end
1677
+
1678
+ # source://actioncable//lib/action_cable/connection/internal_channel.rb#30
1679
+ def unsubscribe_from_internal_channel; end
1680
+ end
1681
+
1682
+ # Allows us to buffer messages received from the WebSocket before the Connection
1683
+ # has been fully initialized, and is ready to receive them.
1684
+ #
1685
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#9
1686
+ class ActionCable::Connection::MessageBuffer
1687
+ # @return [MessageBuffer] a new instance of MessageBuffer
1688
+ #
1689
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#10
1690
+ def initialize(connection); end
1691
+
1692
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#15
1693
+ def append(message); end
1694
+
1695
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#31
1696
+ def process!; end
1697
+
1698
+ # @return [Boolean]
1699
+ #
1700
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#27
1701
+ def processing?; end
1702
+
1703
+ private
1704
+
1705
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#48
1706
+ def buffer(message); end
1707
+
1708
+ # Returns the value of attribute buffered_messages.
1709
+ #
1710
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#38
1711
+ def buffered_messages; end
1712
+
1713
+ # Returns the value of attribute connection.
1714
+ #
1715
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#37
1716
+ def connection; end
1717
+
1718
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#44
1719
+ def receive(message); end
1720
+
1721
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#52
1722
+ def receive_buffered_messages; end
1723
+
1724
+ # @return [Boolean]
1725
+ #
1726
+ # source://actioncable//lib/action_cable/connection/message_buffer.rb#40
1727
+ def valid?(message); end
1728
+ end
1729
+
1730
+ # source://actioncable//lib/action_cable/connection/test_case.rb#14
1731
+ class ActionCable::Connection::NonInferrableConnectionError < ::StandardError
1732
+ # @return [NonInferrableConnectionError] a new instance of NonInferrableConnectionError
1733
+ #
1734
+ # source://actioncable//lib/action_cable/connection/test_case.rb#15
1735
+ def initialize(name); end
1736
+ end
1737
+
1738
+ # source://actioncable//lib/action_cable/connection/stream.rb#11
1739
+ class ActionCable::Connection::Stream
1740
+ # @return [Stream] a new instance of Stream
1741
+ #
1742
+ # source://actioncable//lib/action_cable/connection/stream.rb#12
1743
+ def initialize(event_loop, socket); end
1744
+
1745
+ # source://actioncable//lib/action_cable/connection/stream.rb#28
1746
+ def close; end
1747
+
1748
+ # source://actioncable//lib/action_cable/connection/stream.rb#24
1749
+ def each(&callback); end
1750
+
1751
+ # source://actioncable//lib/action_cable/connection/stream.rb#72
1752
+ def flush_write_buffer; end
1753
+
1754
+ # source://actioncable//lib/action_cable/connection/stream.rb#98
1755
+ def hijack_rack_socket; end
1756
+
1757
+ # source://actioncable//lib/action_cable/connection/stream.rb#94
1758
+ def receive(data); end
1759
+
1760
+ # source://actioncable//lib/action_cable/connection/stream.rb#33
1761
+ def shutdown; end
1762
+
1763
+ # source://actioncable//lib/action_cable/connection/stream.rb#37
1764
+ def write(data); end
1765
+
1766
+ private
1767
+
1768
+ # source://actioncable//lib/action_cable/connection/stream.rb#110
1769
+ def clean_rack_hijack; end
1770
+ end
1771
+
1772
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#9
1773
+ class ActionCable::Connection::StreamEventLoop
1774
+ # @return [StreamEventLoop] a new instance of StreamEventLoop
1775
+ #
1776
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#10
1777
+ def initialize; end
1778
+
1779
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#30
1780
+ def attach(io, stream); end
1781
+
1782
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#38
1783
+ def detach(io, stream); end
1784
+
1785
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#23
1786
+ def post(task = T.unsafe(nil), &block); end
1787
+
1788
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#56
1789
+ def stop; end
1790
+
1791
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#19
1792
+ def timer(interval, &block); end
1793
+
1794
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#47
1795
+ def writes_pending(io); end
1796
+
1797
+ private
1798
+
1799
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#86
1800
+ def run; end
1801
+
1802
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#62
1803
+ def spawn; end
1804
+
1805
+ # source://actioncable//lib/action_cable/connection/stream_event_loop.rb#82
1806
+ def wakeup; end
1807
+ end
1808
+
1809
+ # # Action Cable Connection Subscriptions
1810
+ #
1811
+ # Collection class for all the channel subscriptions established on a given
1812
+ # connection. Responsible for routing incoming commands that arrive on the
1813
+ # connection to the proper channel.
1814
+ #
1815
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#14
1816
+ class ActionCable::Connection::Subscriptions
1817
+ # @return [Subscriptions] a new instance of Subscriptions
1818
+ #
1819
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#15
1820
+ def initialize(connection); end
1821
+
1822
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#33
1823
+ def add(data); end
1824
+
1825
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#20
1826
+ def execute_command(data); end
1827
+
1828
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#64
1829
+ def identifiers; end
1830
+
1831
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#74
1832
+ def logger(*_arg0, **_arg1, &_arg2); end
1833
+
1834
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#60
1835
+ def perform_action(data); end
1836
+
1837
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#50
1838
+ def remove(data); end
1839
+
1840
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#55
1841
+ def remove_subscription(subscription); end
1842
+
1843
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#68
1844
+ def unsubscribe_from_all; end
1845
+
1846
+ private
1847
+
1848
+ # Returns the value of attribute connection.
1849
+ #
1850
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#73
1851
+ def connection; end
1852
+
1853
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#76
1854
+ def find(data); end
1855
+
1856
+ # Returns the value of attribute subscriptions.
1857
+ #
1858
+ # source://actioncable//lib/action_cable/connection/subscriptions.rb#73
1859
+ def subscriptions; end
1860
+ end
1861
+
1862
+ # # Action Cable Connection TaggedLoggerProxy
1863
+ #
1864
+ # Allows the use of per-connection tags against the server logger. This wouldn't
1865
+ # work using the traditional ActiveSupport::TaggedLogging enhanced Rails.logger,
1866
+ # as that logger will reset the tags between requests. The connection is
1867
+ # long-lived, so it needs its own set of tags for its independent duration.
1868
+ #
1869
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#13
1870
+ class ActionCable::Connection::TaggedLoggerProxy
1871
+ # @return [TaggedLoggerProxy] a new instance of TaggedLoggerProxy
1872
+ #
1873
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#16
1874
+ def initialize(logger, tags:); end
1875
+
1876
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#21
1877
+ def add_tags(*tags); end
1878
+
1879
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36
1880
+ def debug(message = T.unsafe(nil), &block); end
1881
+
1882
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36
1883
+ def error(message = T.unsafe(nil), &block); end
1884
+
1885
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36
1886
+ def fatal(message = T.unsafe(nil), &block); end
1887
+
1888
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36
1889
+ def info(message = T.unsafe(nil), &block); end
1890
+
1891
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#26
1892
+ def tag(logger, &block); end
1893
+
1894
+ # Returns the value of attribute tags.
1895
+ #
1896
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#14
1897
+ def tags; end
1898
+
1899
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36
1900
+ def unknown(message = T.unsafe(nil), &block); end
1901
+
1902
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#36
1903
+ def warn(message = T.unsafe(nil), &block); end
1904
+
1905
+ private
1906
+
1907
+ # source://actioncable//lib/action_cable/connection/tagged_logger_proxy.rb#42
1908
+ def log(type, message, &block); end
1909
+ end
1910
+
1911
+ # # Action Cable Connection TestCase
1912
+ #
1913
+ # Unit test Action Cable connections.
1914
+ #
1915
+ # Useful to check whether a connection's `identified_by` gets assigned properly
1916
+ # and that any improper connection requests are rejected.
1917
+ #
1918
+ # ## Basic example
1919
+ #
1920
+ # Unit tests are written by first simulating a connection attempt by calling
1921
+ # `connect` and then asserting state, e.g. identifiers, have been assigned.
1922
+ #
1923
+ # class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
1924
+ # def test_connects_with_proper_cookie
1925
+ # # Simulate the connection request with a cookie.
1926
+ # cookies["user_id"] = users(:john).id
1927
+ #
1928
+ # connect
1929
+ #
1930
+ # # Assert the connection identifier matches the fixture.
1931
+ # assert_equal users(:john).id, connection.user.id
1932
+ # end
1933
+ #
1934
+ # def test_rejects_connection_without_proper_cookie
1935
+ # assert_reject_connection { connect }
1936
+ # end
1937
+ # end
1938
+ #
1939
+ # `connect` accepts additional information about the HTTP request with the
1940
+ # `params`, `headers`, `session`, and Rack `env` options.
1941
+ #
1942
+ # def test_connect_with_headers_and_query_string
1943
+ # connect params: { user_id: 1 }, headers: { "X-API-TOKEN" => "secret-my" }
1944
+ #
1945
+ # assert_equal "1", connection.user.id
1946
+ # assert_equal "secret-my", connection.token
1947
+ # end
1948
+ #
1949
+ # def test_connect_with_params
1950
+ # connect params: { user_id: 1 }
1951
+ #
1952
+ # assert_equal "1", connection.user.id
1953
+ # end
1954
+ #
1955
+ # You can also set up the correct cookies before the connection request:
1956
+ #
1957
+ # def test_connect_with_cookies
1958
+ # # Plain cookies:
1959
+ # cookies["user_id"] = 1
1960
+ #
1961
+ # # Or signed/encrypted:
1962
+ # # cookies.signed["user_id"] = 1
1963
+ # # cookies.encrypted["user_id"] = 1
1964
+ #
1965
+ # connect
1966
+ #
1967
+ # assert_equal "1", connection.user_id
1968
+ # end
1969
+ #
1970
+ # ## Connection is automatically inferred
1971
+ #
1972
+ # ActionCable::Connection::TestCase will automatically infer the connection
1973
+ # under test from the test class name. If the channel cannot be inferred from
1974
+ # the test class name, you can explicitly set it with `tests`.
1975
+ #
1976
+ # class ConnectionTest < ActionCable::Connection::TestCase
1977
+ # tests ApplicationCable::Connection
1978
+ # end
1979
+ #
1980
+ # source://actioncable//lib/action_cable/connection/test_case.rb#138
1981
+ class ActionCable::Connection::TestCase < ::ActiveSupport::TestCase
1982
+ include ::ActiveSupport::Testing::ConstantLookup
1983
+ include ::ActionCable::Connection::Assertions
1984
+ include ::ActionCable::Connection::TestCase::Behavior
1985
+ extend ::ActiveSupport::Testing::ConstantLookup::ClassMethods
1986
+ extend ::ActionCable::Connection::TestCase::Behavior::ClassMethods
1987
+
1988
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
1989
+ def _connection_class; end
1990
+
1991
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
1992
+ def _connection_class=(_arg0); end
1993
+
1994
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
1995
+ def _connection_class?; end
1996
+
1997
+ # source://actioncable//lib/action_cable/connection/test_case.rb#150
1998
+ def connection; end
1999
+
2000
+ class << self
2001
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
2002
+ def _connection_class; end
2003
+
2004
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
2005
+ def _connection_class=(value); end
2006
+
2007
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
2008
+ def _connection_class?; end
2009
+
2010
+ private
2011
+
2012
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
2013
+ def __class_attr__connection_class; end
2014
+
2015
+ # source://actioncable//lib/action_cable/connection/test_case.rb#148
2016
+ def __class_attr__connection_class=(new_value); end
2017
+ end
2018
+ end
2019
+
2020
+ # source://actioncable//lib/action_cable/connection/test_case.rb#139
2021
+ module ActionCable::Connection::TestCase::Behavior
2022
+ include ::ActionCable::Connection::Assertions
2023
+ extend ::ActiveSupport::Concern
2024
+ include GeneratedInstanceMethods
2025
+ include ::ActiveSupport::Testing::ConstantLookup
2026
+
2027
+ mixes_in_class_methods GeneratedClassMethods
2028
+ mixes_in_class_methods ::ActiveSupport::Testing::ConstantLookup::ClassMethods
2029
+ mixes_in_class_methods ::ActionCable::Connection::TestCase::Behavior::ClassMethods
2030
+
2031
+ # Performs connection attempt to exert #connect on the connection under test.
2032
+ #
2033
+ # Accepts request path as the first argument and the following request options:
2034
+ #
2035
+ # * params – URL parameters (Hash)
2036
+ # * headers – request headers (Hash)
2037
+ # * session – session data (Hash)
2038
+ # * env – additional Rack env configuration (Hash)
2039
+ #
2040
+ # source://actioncable//lib/action_cable/connection/test_case.rb#192
2041
+ def connect(path = T.unsafe(nil), **request_params); end
2042
+
2043
+ # source://actioncable//lib/action_cable/connection/test_case.rb#212
2044
+ def cookies; end
2045
+
2046
+ # Exert #disconnect on the connection under test.
2047
+ #
2048
+ # source://actioncable//lib/action_cable/connection/test_case.rb#205
2049
+ def disconnect; end
2050
+
2051
+ private
2052
+
2053
+ # source://actioncable//lib/action_cable/connection/test_case.rb#217
2054
+ def build_test_request(path, params: T.unsafe(nil), headers: T.unsafe(nil), session: T.unsafe(nil), env: T.unsafe(nil)); end
2055
+
2056
+ module GeneratedClassMethods
2057
+ def _connection_class; end
2058
+ def _connection_class=(value); end
2059
+ def _connection_class?; end
2060
+ end
2061
+
2062
+ module GeneratedInstanceMethods
2063
+ def _connection_class; end
2064
+ def _connection_class=(value); end
2065
+ def _connection_class?; end
2066
+ end
2067
+ end
2068
+
2069
+ # source://actioncable//lib/action_cable/connection/test_case.rb#155
2070
+ module ActionCable::Connection::TestCase::Behavior::ClassMethods
2071
+ # source://actioncable//lib/action_cable/connection/test_case.rb#167
2072
+ def connection_class; end
2073
+
2074
+ # @raise [NonInferrableConnectionError]
2075
+ #
2076
+ # source://actioncable//lib/action_cable/connection/test_case.rb#175
2077
+ def determine_default_connection(name); end
2078
+
2079
+ # source://actioncable//lib/action_cable/connection/test_case.rb#156
2080
+ def tests(connection); end
2081
+ end
2082
+
2083
+ # source://actioncable//lib/action_cable/connection/test_case.rb#142
2084
+ ActionCable::Connection::TestCase::Behavior::DEFAULT_PATH = T.let(T.unsafe(nil), String)
2085
+
2086
+ # source://actioncable//lib/action_cable/connection/test_case.rb#57
2087
+ module ActionCable::Connection::TestConnection
2088
+ # source://actioncable//lib/action_cable/connection/test_case.rb#60
2089
+ def initialize(request); end
2090
+
2091
+ # Returns the value of attribute logger.
2092
+ #
2093
+ # source://actioncable//lib/action_cable/connection/test_case.rb#58
2094
+ def logger; end
2095
+
2096
+ # Returns the value of attribute request.
2097
+ #
2098
+ # source://actioncable//lib/action_cable/connection/test_case.rb#58
2099
+ def request; end
2100
+ end
2101
+
2102
+ # We don't want to use the whole "encryption stack" for connection unit-tests,
2103
+ # but we want to make sure that users test against the correct types of cookies
2104
+ # (i.e. signed or encrypted or plain)
2105
+ #
2106
+ # source://actioncable//lib/action_cable/connection/test_case.rb#43
2107
+ class ActionCable::Connection::TestCookieJar < ::ActionCable::Connection::TestCookies
2108
+ # source://actioncable//lib/action_cable/connection/test_case.rb#48
2109
+ def encrypted; end
2110
+
2111
+ # source://actioncable//lib/action_cable/connection/test_case.rb#44
2112
+ def signed; end
2113
+ end
2114
+
2115
+ # source://actioncable//lib/action_cable/connection/test_case.rb#33
2116
+ class ActionCable::Connection::TestCookies < ::ActiveSupport::HashWithIndifferentAccess
2117
+ # source://actioncable//lib/action_cable/connection/test_case.rb#34
2118
+ def []=(name, options); end
2119
+ end
2120
+
2121
+ # source://actioncable//lib/action_cable/connection/test_case.rb#53
2122
+ class ActionCable::Connection::TestRequest < ::ActionDispatch::TestRequest
2123
+ # Returns the value of attribute cookie_jar.
2124
+ #
2125
+ # source://actioncable//lib/action_cable/connection/test_case.rb#54
2126
+ def cookie_jar; end
2127
+
2128
+ # Sets the attribute cookie_jar
2129
+ #
2130
+ # @param value the value to set the attribute cookie_jar to.
2131
+ #
2132
+ # source://actioncable//lib/action_cable/connection/test_case.rb#54
2133
+ def cookie_jar=(_arg0); end
2134
+
2135
+ # Returns the value of attribute session.
2136
+ #
2137
+ # source://actioncable//lib/action_cable/connection/test_case.rb#54
2138
+ def session; end
2139
+
2140
+ # Sets the attribute session
2141
+ #
2142
+ # @param value the value to set the attribute session to.
2143
+ #
2144
+ # source://actioncable//lib/action_cable/connection/test_case.rb#54
2145
+ def session=(_arg0); end
2146
+ end
2147
+
2148
+ # # Action Cable Connection WebSocket
2149
+ #
2150
+ # Wrap the real socket to minimize the externally-presented API
2151
+ #
2152
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#12
2153
+ class ActionCable::Connection::WebSocket
2154
+ # @return [WebSocket] a new instance of WebSocket
2155
+ #
2156
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#13
2157
+ def initialize(env, event_target, event_loop, protocols: T.unsafe(nil)); end
2158
+
2159
+ # @return [Boolean]
2160
+ #
2161
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#21
2162
+ def alive?; end
2163
+
2164
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#29
2165
+ def close(*_arg0, **_arg1, &_arg2); end
2166
+
2167
+ # @return [Boolean]
2168
+ #
2169
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#17
2170
+ def possible?; end
2171
+
2172
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#33
2173
+ def protocol; end
2174
+
2175
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#37
2176
+ def rack_response; end
2177
+
2178
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#25
2179
+ def transmit(*_arg0, **_arg1, &_arg2); end
2180
+
2181
+ private
2182
+
2183
+ # Returns the value of attribute websocket.
2184
+ #
2185
+ # source://actioncable//lib/action_cable/connection/web_socket.rb#42
2186
+ def websocket; end
2187
+ end
2188
+
2189
+ # source://actioncable//lib/action_cable/engine.rb#10
2190
+ class ActionCable::Engine < ::Rails::Engine; end
2191
+
2192
+ # source://actioncable//lib/action_cable/helpers/action_cable_helper.rb#6
2193
+ module ActionCable::Helpers; end
2194
+
2195
+ # source://actioncable//lib/action_cable/helpers/action_cable_helper.rb#7
2196
+ module ActionCable::Helpers::ActionCableHelper
2197
+ # Returns an "action-cable-url" meta tag with the value of the URL specified in
2198
+ # your configuration. Ensure this is above your JavaScript tag:
2199
+ #
2200
+ # <head>
2201
+ # <%= action_cable_meta_tag %>
2202
+ # <%= javascript_include_tag 'application', 'data-turbo-track' => 'reload' %>
2203
+ # </head>
2204
+ #
2205
+ # This is then used by Action Cable to determine the URL of your WebSocket
2206
+ # server. Your JavaScript can then connect to the server without needing to
2207
+ # specify the URL directly:
2208
+ #
2209
+ # import Cable from "@rails/actioncable"
2210
+ # window.Cable = Cable
2211
+ # window.App = {}
2212
+ # App.cable = Cable.createConsumer()
2213
+ #
2214
+ # Make sure to specify the correct server location in each of your environment
2215
+ # config files:
2216
+ #
2217
+ # config.action_cable.mount_path = "/cable123"
2218
+ # <%= action_cable_meta_tag %> would render:
2219
+ # => <meta name="action-cable-url" content="/cable123" />
2220
+ #
2221
+ # config.action_cable.url = "ws://actioncable.com"
2222
+ # <%= action_cable_meta_tag %> would render:
2223
+ # => <meta name="action-cable-url" content="ws://actioncable.com" />
2224
+ #
2225
+ # source://actioncable//lib/action_cable/helpers/action_cable_helper.rb#36
2226
+ def action_cable_meta_tag; end
2227
+ end
2228
+
2229
+ # source://actioncable//lib/action_cable.rb#58
2230
+ ActionCable::INTERNAL = T.let(T.unsafe(nil), Hash)
2231
+
2232
+ # # Action Cable Remote Connections
2233
+ #
2234
+ # If you need to disconnect a given connection, you can go through the
2235
+ # RemoteConnections. You can find the connections you're looking for by
2236
+ # searching for the identifier declared on the connection. For example:
2237
+ #
2238
+ # module ApplicationCable
2239
+ # class Connection < ActionCable::Connection::Base
2240
+ # identified_by :current_user
2241
+ # ....
2242
+ # end
2243
+ # end
2244
+ #
2245
+ # ActionCable.server.remote_connections.where(current_user: User.find(1)).disconnect
2246
+ #
2247
+ # This will disconnect all the connections established for `User.find(1)`,
2248
+ # across all servers running on all machines, because it uses the internal
2249
+ # channel that all of these servers are subscribed to.
2250
+ #
2251
+ # By default, server sends a "disconnect" message with "reconnect" flag set to
2252
+ # true. You can override it by specifying the `reconnect` option:
2253
+ #
2254
+ # ActionCable.server.remote_connections.where(current_user: User.find(1)).disconnect(reconnect: false)
2255
+ #
2256
+ # source://actioncable//lib/action_cable/remote_connections.rb#31
2257
+ class ActionCable::RemoteConnections
2258
+ # @return [RemoteConnections] a new instance of RemoteConnections
2259
+ #
2260
+ # source://actioncable//lib/action_cable/remote_connections.rb#34
2261
+ def initialize(server); end
2262
+
2263
+ # Returns the value of attribute server.
2264
+ #
2265
+ # source://actioncable//lib/action_cable/remote_connections.rb#32
2266
+ def server; end
2267
+
2268
+ # source://actioncable//lib/action_cable/remote_connections.rb#38
2269
+ def where(identifier); end
2270
+ end
2271
+
2272
+ # # Action Cable Remote Connection
2273
+ #
2274
+ # Represents a single remote connection found via
2275
+ # `ActionCable.server.remote_connections.where(*)`. Exists solely for the
2276
+ # purpose of calling #disconnect on that connection.
2277
+ #
2278
+ # source://actioncable//lib/action_cable/remote_connections.rb#47
2279
+ class ActionCable::RemoteConnections::RemoteConnection
2280
+ include ::ActionCable::Connection::InternalChannel
2281
+ include ::ActionCable::Connection::Identification
2282
+ extend ::ActionCable::Connection::Identification::ClassMethods
2283
+
2284
+ # @return [RemoteConnection] a new instance of RemoteConnection
2285
+ #
2286
+ # source://actioncable//lib/action_cable/remote_connections.rb#52
2287
+ def initialize(server, ids); end
2288
+
2289
+ # Uses the internal channel to disconnect the connection.
2290
+ #
2291
+ # source://actioncable//lib/action_cable/remote_connections.rb#58
2292
+ def disconnect(reconnect: T.unsafe(nil)); end
2293
+
2294
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2295
+ def identifiers; end
2296
+
2297
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2298
+ def identifiers=(_arg0); end
2299
+
2300
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2301
+ def identifiers?; end
2302
+
2303
+ protected
2304
+
2305
+ # Returns the value of attribute server.
2306
+ #
2307
+ # source://actioncable//lib/action_cable/remote_connections.rb#68
2308
+ def server; end
2309
+
2310
+ private
2311
+
2312
+ # @raise [InvalidIdentifiersError]
2313
+ #
2314
+ # source://actioncable//lib/action_cable/remote_connections.rb#71
2315
+ def set_identifier_instance_vars(ids); end
2316
+
2317
+ # @return [Boolean]
2318
+ #
2319
+ # source://actioncable//lib/action_cable/remote_connections.rb#76
2320
+ def valid_identifiers?(ids); end
2321
+
2322
+ class << self
2323
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2324
+ def identifiers; end
2325
+
2326
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2327
+ def identifiers=(value); end
2328
+
2329
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2330
+ def identifiers?; end
2331
+
2332
+ private
2333
+
2334
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2335
+ def __class_attr_identifiers; end
2336
+
2337
+ # source://actioncable//lib/action_cable/remote_connections.rb#50
2338
+ def __class_attr_identifiers=(new_value); end
2339
+ end
2340
+ end
2341
+
2342
+ # source://actioncable//lib/action_cable/remote_connections.rb#48
2343
+ class ActionCable::RemoteConnections::RemoteConnection::InvalidIdentifiersError < ::StandardError; end
2344
+
2345
+ # source://actioncable//lib/action_cable/server/base.rb#8
2346
+ module ActionCable::Server; end
2347
+
2348
+ # # Action Cable Server Base
2349
+ #
2350
+ # A singleton ActionCable::Server instance is available via ActionCable.server.
2351
+ # It's used by the Rack process that starts the Action Cable server, but is also
2352
+ # used by the user to reach the RemoteConnections object, which is used for
2353
+ # finding and disconnecting connections across all servers.
2354
+ #
2355
+ # Also, this is the server instance used for broadcasting. See Broadcasting for
2356
+ # more information.
2357
+ #
2358
+ # source://actioncable//lib/action_cable/server/base.rb#18
2359
+ class ActionCable::Server::Base
2360
+ include ::ActionCable::Server::Broadcasting
2361
+ include ::ActionCable::Server::Connections
2362
+
2363
+ # @return [Base] a new instance of Base
2364
+ #
2365
+ # source://actioncable//lib/action_cable/server/base.rb#31
2366
+ def initialize(config: T.unsafe(nil)); end
2367
+
2368
+ # Called by Rack to set up the server.
2369
+ #
2370
+ # source://actioncable//lib/action_cable/server/base.rb#38
2371
+ def call(env); end
2372
+
2373
+ # Returns the value of attribute config.
2374
+ #
2375
+ # source://actioncable//lib/action_cable/server/base.rb#24
2376
+ def config; end
2377
+
2378
+ # All of the identifiers applied to the connection class associated with this
2379
+ # server.
2380
+ #
2381
+ # source://actioncable//lib/action_cable/server/base.rb#102
2382
+ def connection_identifiers; end
2383
+
2384
+ # Disconnect all the connections identified by `identifiers` on this server or
2385
+ # any others via RemoteConnections.
2386
+ #
2387
+ # source://actioncable//lib/action_cable/server/base.rb#46
2388
+ def disconnect(identifiers); end
2389
+
2390
+ # source://actioncable//lib/action_cable/server/base.rb#71
2391
+ def event_loop; end
2392
+
2393
+ # source://actioncable//lib/action_cable/server/base.rb#27
2394
+ def logger(*_arg0, **_arg1, &_arg2); end
2395
+
2396
+ # Returns the value of attribute mutex.
2397
+ #
2398
+ # source://actioncable//lib/action_cable/server/base.rb#29
2399
+ def mutex; end
2400
+
2401
+ # Adapter used for all streams/broadcasting.
2402
+ #
2403
+ # source://actioncable//lib/action_cable/server/base.rb#96
2404
+ def pubsub; end
2405
+
2406
+ # Gateway to RemoteConnections. See that class for details.
2407
+ #
2408
+ # source://actioncable//lib/action_cable/server/base.rb#67
2409
+ def remote_connections; end
2410
+
2411
+ # source://actioncable//lib/action_cable/server/base.rb#50
2412
+ def restart; end
2413
+
2414
+ # The worker pool is where we run connection callbacks and channel actions. We
2415
+ # do as little as possible on the server's main thread. The worker pool is an
2416
+ # executor service that's backed by a pool of threads working from a task queue.
2417
+ # The thread pool size maxes out at 4 worker threads by default. Tune the size
2418
+ # yourself with `config.action_cable.worker_pool_size`.
2419
+ #
2420
+ # Using Active Record, Redis, etc within your channel actions means you'll get a
2421
+ # separate connection from each thread in the worker pool. Plan your deployment
2422
+ # accordingly: 5 servers each running 5 Puma workers each running an 8-thread
2423
+ # worker pool means at least 200 database connections.
2424
+ #
2425
+ # Also, ensure that your database connection pool size is as least as large as
2426
+ # your worker pool size. Otherwise, workers may oversubscribe the database
2427
+ # connection pool and block while they wait for other workers to release their
2428
+ # connections. Use a smaller worker pool or a larger database connection pool
2429
+ # instead.
2430
+ #
2431
+ # source://actioncable//lib/action_cable/server/base.rb#91
2432
+ def worker_pool; end
2433
+
2434
+ class << self
2435
+ # source://actioncable//lib/action_cable/server/base.rb#22
2436
+ def config; end
2437
+
2438
+ # source://actioncable//lib/action_cable/server/base.rb#22
2439
+ def config=(val); end
2440
+
2441
+ # source://actioncable//lib/action_cable/server/base.rb#26
2442
+ def logger; end
2443
+ end
2444
+ end
2445
+
2446
+ # # Action Cable Server Broadcasting
2447
+ #
2448
+ # Broadcasting is how other parts of your application can send messages to a
2449
+ # channel's subscribers. As explained in Channel, most of the time, these
2450
+ # broadcastings are streamed directly to the clients subscribed to the named
2451
+ # broadcasting. Let's explain with a full-stack example:
2452
+ #
2453
+ # class WebNotificationsChannel < ApplicationCable::Channel
2454
+ # def subscribed
2455
+ # stream_from "web_notifications_#{current_user.id}"
2456
+ # end
2457
+ # end
2458
+ #
2459
+ # # Somewhere in your app this is called, perhaps from a NewCommentJob:
2460
+ # ActionCable.server.broadcast \
2461
+ # "web_notifications_1", { title: "New things!", body: "All that's fit for print" }
2462
+ #
2463
+ # # Client-side CoffeeScript, which assumes you've already requested the right to send web notifications:
2464
+ # App.cable.subscriptions.create "WebNotificationsChannel",
2465
+ # received: (data) ->
2466
+ # new Notification data['title'], body: data['body']
2467
+ #
2468
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#28
2469
+ module ActionCable::Server::Broadcasting
2470
+ # Broadcast a hash directly to a named `broadcasting`. This will later be JSON
2471
+ # encoded.
2472
+ #
2473
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#31
2474
+ def broadcast(broadcasting, message, coder: T.unsafe(nil)); end
2475
+
2476
+ # Returns a broadcaster for a named `broadcasting` that can be reused. Useful
2477
+ # when you have an object that may need multiple spots to transmit to a specific
2478
+ # broadcasting over and over.
2479
+ #
2480
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#38
2481
+ def broadcaster_for(broadcasting, coder: T.unsafe(nil)); end
2482
+ end
2483
+
2484
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#43
2485
+ class ActionCable::Server::Broadcasting::Broadcaster
2486
+ # @return [Broadcaster] a new instance of Broadcaster
2487
+ #
2488
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#46
2489
+ def initialize(server, broadcasting, coder:); end
2490
+
2491
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#50
2492
+ def broadcast(message); end
2493
+
2494
+ # Returns the value of attribute broadcasting.
2495
+ #
2496
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#44
2497
+ def broadcasting; end
2498
+
2499
+ # Returns the value of attribute coder.
2500
+ #
2501
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#44
2502
+ def coder; end
2503
+
2504
+ # Returns the value of attribute server.
2505
+ #
2506
+ # source://actioncable//lib/action_cable/server/broadcasting.rb#44
2507
+ def server; end
2508
+ end
2509
+
2510
+ # # Action Cable Server Configuration
2511
+ #
2512
+ # An instance of this configuration object is available via
2513
+ # ActionCable.server.config, which allows you to tweak Action Cable
2514
+ # configuration in a Rails config initializer.
2515
+ #
2516
+ # source://actioncable//lib/action_cable/server/configuration.rb#14
2517
+ class ActionCable::Server::Configuration
2518
+ # @return [Configuration] a new instance of Configuration
2519
+ #
2520
+ # source://actioncable//lib/action_cable/server/configuration.rb#22
2521
+ def initialize; end
2522
+
2523
+ # Returns the value of attribute allow_same_origin_as_host.
2524
+ #
2525
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2526
+ def allow_same_origin_as_host; end
2527
+
2528
+ # Sets the attribute allow_same_origin_as_host
2529
+ #
2530
+ # @param value the value to set the attribute allow_same_origin_as_host to.
2531
+ #
2532
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2533
+ def allow_same_origin_as_host=(_arg0); end
2534
+
2535
+ # Returns the value of attribute allowed_request_origins.
2536
+ #
2537
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2538
+ def allowed_request_origins; end
2539
+
2540
+ # Sets the attribute allowed_request_origins
2541
+ #
2542
+ # @param value the value to set the attribute allowed_request_origins to.
2543
+ #
2544
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2545
+ def allowed_request_origins=(_arg0); end
2546
+
2547
+ # Returns the value of attribute cable.
2548
+ #
2549
+ # source://actioncable//lib/action_cable/server/configuration.rb#18
2550
+ def cable; end
2551
+
2552
+ # Sets the attribute cable
2553
+ #
2554
+ # @param value the value to set the attribute cable to.
2555
+ #
2556
+ # source://actioncable//lib/action_cable/server/configuration.rb#18
2557
+ def cable=(_arg0); end
2558
+
2559
+ # Returns the value of attribute connection_class.
2560
+ #
2561
+ # source://actioncable//lib/action_cable/server/configuration.rb#16
2562
+ def connection_class; end
2563
+
2564
+ # Sets the attribute connection_class
2565
+ #
2566
+ # @param value the value to set the attribute connection_class to.
2567
+ #
2568
+ # source://actioncable//lib/action_cable/server/configuration.rb#16
2569
+ def connection_class=(_arg0); end
2570
+
2571
+ # Returns the value of attribute disable_request_forgery_protection.
2572
+ #
2573
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2574
+ def disable_request_forgery_protection; end
2575
+
2576
+ # Sets the attribute disable_request_forgery_protection
2577
+ #
2578
+ # @param value the value to set the attribute disable_request_forgery_protection to.
2579
+ #
2580
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2581
+ def disable_request_forgery_protection=(_arg0); end
2582
+
2583
+ # Returns the value of attribute filter_parameters.
2584
+ #
2585
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2586
+ def filter_parameters; end
2587
+
2588
+ # Sets the attribute filter_parameters
2589
+ #
2590
+ # @param value the value to set the attribute filter_parameters to.
2591
+ #
2592
+ # source://actioncable//lib/action_cable/server/configuration.rb#17
2593
+ def filter_parameters=(_arg0); end
2594
+
2595
+ # Returns the value of attribute health_check_application.
2596
+ #
2597
+ # source://actioncable//lib/action_cable/server/configuration.rb#20
2598
+ def health_check_application; end
2599
+
2600
+ # Sets the attribute health_check_application
2601
+ #
2602
+ # @param value the value to set the attribute health_check_application to.
2603
+ #
2604
+ # source://actioncable//lib/action_cable/server/configuration.rb#20
2605
+ def health_check_application=(_arg0); end
2606
+
2607
+ # Returns the value of attribute health_check_path.
2608
+ #
2609
+ # source://actioncable//lib/action_cable/server/configuration.rb#20
2610
+ def health_check_path; end
2611
+
2612
+ # Sets the attribute health_check_path
2613
+ #
2614
+ # @param value the value to set the attribute health_check_path to.
2615
+ #
2616
+ # source://actioncable//lib/action_cable/server/configuration.rb#20
2617
+ def health_check_path=(_arg0); end
2618
+
2619
+ # Returns the value of attribute log_tags.
2620
+ #
2621
+ # source://actioncable//lib/action_cable/server/configuration.rb#15
2622
+ def log_tags; end
2623
+
2624
+ # Sets the attribute log_tags
2625
+ #
2626
+ # @param value the value to set the attribute log_tags to.
2627
+ #
2628
+ # source://actioncable//lib/action_cable/server/configuration.rb#15
2629
+ def log_tags=(_arg0); end
2630
+
2631
+ # Returns the value of attribute logger.
2632
+ #
2633
+ # source://actioncable//lib/action_cable/server/configuration.rb#15
2634
+ def logger; end
2635
+
2636
+ # Sets the attribute logger
2637
+ #
2638
+ # @param value the value to set the attribute logger to.
2639
+ #
2640
+ # source://actioncable//lib/action_cable/server/configuration.rb#15
2641
+ def logger=(_arg0); end
2642
+
2643
+ # Returns the value of attribute mount_path.
2644
+ #
2645
+ # source://actioncable//lib/action_cable/server/configuration.rb#18
2646
+ def mount_path; end
2647
+
2648
+ # Sets the attribute mount_path
2649
+ #
2650
+ # @param value the value to set the attribute mount_path to.
2651
+ #
2652
+ # source://actioncable//lib/action_cable/server/configuration.rb#18
2653
+ def mount_path=(_arg0); end
2654
+
2655
+ # Returns the value of attribute precompile_assets.
2656
+ #
2657
+ # source://actioncable//lib/action_cable/server/configuration.rb#19
2658
+ def precompile_assets; end
2659
+
2660
+ # Sets the attribute precompile_assets
2661
+ #
2662
+ # @param value the value to set the attribute precompile_assets to.
2663
+ #
2664
+ # source://actioncable//lib/action_cable/server/configuration.rb#19
2665
+ def precompile_assets=(_arg0); end
2666
+
2667
+ # Returns constant of subscription adapter specified in config/cable.yml. If the
2668
+ # adapter cannot be found, this will default to the Redis adapter. Also makes
2669
+ # sure proper dependencies are required.
2670
+ #
2671
+ # source://actioncable//lib/action_cable/server/configuration.rb#40
2672
+ def pubsub_adapter; end
2673
+
2674
+ # Returns the value of attribute url.
2675
+ #
2676
+ # source://actioncable//lib/action_cable/server/configuration.rb#18
2677
+ def url; end
2678
+
2679
+ # Sets the attribute url
2680
+ #
2681
+ # @param value the value to set the attribute url to.
2682
+ #
2683
+ # source://actioncable//lib/action_cable/server/configuration.rb#18
2684
+ def url=(_arg0); end
2685
+
2686
+ # Returns the value of attribute worker_pool_size.
2687
+ #
2688
+ # source://actioncable//lib/action_cable/server/configuration.rb#16
2689
+ def worker_pool_size; end
2690
+
2691
+ # Sets the attribute worker_pool_size
2692
+ #
2693
+ # @param value the value to set the attribute worker_pool_size to.
2694
+ #
2695
+ # source://actioncable//lib/action_cable/server/configuration.rb#16
2696
+ def worker_pool_size=(_arg0); end
2697
+ end
2698
+
2699
+ # # Action Cable Server Connections
2700
+ #
2701
+ # Collection class for all the connections that have been established on this
2702
+ # specific server. Remember, usually you'll run many Action Cable servers, so
2703
+ # you can't use this collection as a full list of all of the connections
2704
+ # established against your application. Instead, use RemoteConnections for that.
2705
+ #
2706
+ # source://actioncable//lib/action_cable/server/connections.rb#13
2707
+ module ActionCable::Server::Connections
2708
+ # source://actioncable//lib/action_cable/server/connections.rb#20
2709
+ def add_connection(connection); end
2710
+
2711
+ # source://actioncable//lib/action_cable/server/connections.rb#16
2712
+ def connections; end
2713
+
2714
+ # source://actioncable//lib/action_cable/server/connections.rb#39
2715
+ def open_connections_statistics; end
2716
+
2717
+ # source://actioncable//lib/action_cable/server/connections.rb#24
2718
+ def remove_connection(connection); end
2719
+
2720
+ # WebSocket connection implementations differ on when they'll mark a connection
2721
+ # as stale. We basically never want a connection to go stale, as you then can't
2722
+ # rely on being able to communicate with the connection. To solve this, a 3
2723
+ # second heartbeat runs on all connections. If the beat fails, we automatically
2724
+ # disconnect.
2725
+ #
2726
+ # source://actioncable//lib/action_cable/server/connections.rb#33
2727
+ def setup_heartbeat_timer; end
2728
+ end
2729
+
2730
+ # source://actioncable//lib/action_cable/server/connections.rb#14
2731
+ ActionCable::Server::Connections::BEAT_INTERVAL = T.let(T.unsafe(nil), Integer)
2732
+
2733
+ # Worker used by Server.send_async to do connection work in threads.
2734
+ #
2735
+ # source://actioncable//lib/action_cable/server/worker.rb#12
2736
+ class ActionCable::Server::Worker
2737
+ include ::ActiveSupport::Callbacks
2738
+ include ::ActionCable::Server::Worker::ActiveRecordConnectionManagement
2739
+ extend ::ActiveSupport::Callbacks::ClassMethods
2740
+ extend ::ActiveSupport::DescendantsTracker
2741
+
2742
+ # @return [Worker] a new instance of Worker
2743
+ #
2744
+ # source://actioncable//lib/action_cable/server/worker.rb#21
2745
+ def initialize(max_size: T.unsafe(nil)); end
2746
+
2747
+ # source://actioncable//lib/action_cable/server/worker.rb#13
2748
+ def __callbacks; end
2749
+
2750
+ # source://actioncable//lib/action_cable/server/worker.rb#16
2751
+ def _run_work_callbacks(&block); end
2752
+
2753
+ # source://actioncable//lib/action_cable/server/worker.rb#16
2754
+ def _work_callbacks; end
2755
+
2756
+ # source://actioncable//lib/action_cable/server/worker.rb#48
2757
+ def async_exec(receiver, *args, connection:, &block); end
2758
+
2759
+ # source://actioncable//lib/action_cable/server/worker.rb#52
2760
+ def async_invoke(receiver, method, *args, connection: T.unsafe(nil), &block); end
2761
+
2762
+ # source://actioncable//lib/action_cable/server/worker.rb#15
2763
+ def connection; end
2764
+
2765
+ # source://actioncable//lib/action_cable/server/worker.rb#15
2766
+ def connection=(obj); end
2767
+
2768
+ # Returns the value of attribute executor.
2769
+ #
2770
+ # source://actioncable//lib/action_cable/server/worker.rb#19
2771
+ def executor; end
2772
+
2773
+ # Stop processing work: any work that has not already started running will be
2774
+ # discarded from the queue
2775
+ #
2776
+ # source://actioncable//lib/action_cable/server/worker.rb#32
2777
+ def halt; end
2778
+
2779
+ # source://actioncable//lib/action_cable/server/worker.rb#58
2780
+ def invoke(receiver, method, *args, connection:, &block); end
2781
+
2782
+ # @return [Boolean]
2783
+ #
2784
+ # source://actioncable//lib/action_cable/server/worker.rb#36
2785
+ def stopping?; end
2786
+
2787
+ # source://actioncable//lib/action_cable/server/worker.rb#40
2788
+ def work(connection, &block); end
2789
+
2790
+ private
2791
+
2792
+ # source://actioncable//lib/action_cable/server/worker.rb#70
2793
+ def logger; end
2794
+
2795
+ class << self
2796
+ # source://actioncable//lib/action_cable/server/worker.rb#13
2797
+ def __callbacks; end
2798
+
2799
+ # source://actioncable//lib/action_cable/server/worker.rb#13
2800
+ def __callbacks=(value); end
2801
+
2802
+ # source://actioncable//lib/action_cable/server/worker.rb#16
2803
+ def _work_callbacks; end
2804
+
2805
+ # source://actioncable//lib/action_cable/server/worker.rb#16
2806
+ def _work_callbacks=(value); end
2807
+
2808
+ # source://actioncable//lib/action_cable/server/worker.rb#15
2809
+ def connection; end
2810
+
2811
+ # source://actioncable//lib/action_cable/server/worker.rb#15
2812
+ def connection=(obj); end
2813
+
2814
+ private
2815
+
2816
+ # source://actioncable//lib/action_cable/server/worker.rb#13
2817
+ def __class_attr___callbacks; end
2818
+
2819
+ # source://actioncable//lib/action_cable/server/worker.rb#13
2820
+ def __class_attr___callbacks=(new_value); end
2821
+ end
2822
+ end
2823
+
2824
+ # source://actioncable//lib/action_cable/server/worker/active_record_connection_management.rb#8
2825
+ module ActionCable::Server::Worker::ActiveRecordConnectionManagement
2826
+ extend ::ActiveSupport::Concern
2827
+
2828
+ # source://actioncable//lib/action_cable/server/worker/active_record_connection_management.rb#17
2829
+ def with_database_connections(&block); end
2830
+ end
2831
+
2832
+ # source://actioncable//lib/action_cable/subscription_adapter/async.rb#6
2833
+ module ActionCable::SubscriptionAdapter; end
2834
+
2835
+ # source://actioncable//lib/action_cable/subscription_adapter/async.rb#7
2836
+ class ActionCable::SubscriptionAdapter::Async < ::ActionCable::SubscriptionAdapter::Inline
2837
+ private
2838
+
2839
+ # source://actioncable//lib/action_cable/subscription_adapter/async.rb#9
2840
+ def new_subscriber_map; end
2841
+ end
2842
+
2843
+ # source://actioncable//lib/action_cable/subscription_adapter/async.rb#13
2844
+ class ActionCable::SubscriptionAdapter::Async::AsyncSubscriberMap < ::ActionCable::SubscriptionAdapter::SubscriberMap
2845
+ # @return [AsyncSubscriberMap] a new instance of AsyncSubscriberMap
2846
+ #
2847
+ # source://actioncable//lib/action_cable/subscription_adapter/async.rb#14
2848
+ def initialize(event_loop); end
2849
+
2850
+ # source://actioncable//lib/action_cable/subscription_adapter/async.rb#19
2851
+ def add_subscriber(*_arg0); end
2852
+
2853
+ # source://actioncable//lib/action_cable/subscription_adapter/async.rb#23
2854
+ def invoke_callback(*_arg0); end
2855
+ end
2856
+
2857
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#7
2858
+ class ActionCable::SubscriptionAdapter::Base
2859
+ # @return [Base] a new instance of Base
2860
+ #
2861
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#10
2862
+ def initialize(server); end
2863
+
2864
+ # @raise [NotImplementedError]
2865
+ #
2866
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#15
2867
+ def broadcast(channel, payload); end
2868
+
2869
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#31
2870
+ def identifier; end
2871
+
2872
+ # Returns the value of attribute logger.
2873
+ #
2874
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#8
2875
+ def logger; end
2876
+
2877
+ # Returns the value of attribute server.
2878
+ #
2879
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#8
2880
+ def server; end
2881
+
2882
+ # @raise [NotImplementedError]
2883
+ #
2884
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#27
2885
+ def shutdown; end
2886
+
2887
+ # @raise [NotImplementedError]
2888
+ #
2889
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#19
2890
+ def subscribe(channel, message_callback, success_callback = T.unsafe(nil)); end
2891
+
2892
+ # @raise [NotImplementedError]
2893
+ #
2894
+ # source://actioncable//lib/action_cable/subscription_adapter/base.rb#23
2895
+ def unsubscribe(channel, message_callback); end
2896
+ end
2897
+
2898
+ # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#7
2899
+ module ActionCable::SubscriptionAdapter::ChannelPrefix
2900
+ # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#8
2901
+ def broadcast(channel, payload); end
2902
+
2903
+ # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#13
2904
+ def subscribe(channel, callback, success_callback = T.unsafe(nil)); end
2905
+
2906
+ # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#18
2907
+ def unsubscribe(channel, callback); end
2908
+
2909
+ private
2910
+
2911
+ # Returns the channel name, including channel_prefix specified in cable.yml
2912
+ #
2913
+ # source://actioncable//lib/action_cable/subscription_adapter/channel_prefix.rb#25
2914
+ def channel_with_prefix(channel); end
2915
+ end
2916
+
2917
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#7
2918
+ class ActionCable::SubscriptionAdapter::Inline < ::ActionCable::SubscriptionAdapter::Base
2919
+ # @return [Inline] a new instance of Inline
2920
+ #
2921
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#8
2922
+ def initialize(*_arg0); end
2923
+
2924
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#13
2925
+ def broadcast(channel, payload); end
2926
+
2927
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#25
2928
+ def shutdown; end
2929
+
2930
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#17
2931
+ def subscribe(channel, callback, success_callback = T.unsafe(nil)); end
2932
+
2933
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#21
2934
+ def unsubscribe(channel, callback); end
2935
+
2936
+ private
2937
+
2938
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#34
2939
+ def new_subscriber_map; end
2940
+
2941
+ # source://actioncable//lib/action_cable/subscription_adapter/inline.rb#30
2942
+ def subscriber_map; end
2943
+ end
2944
+
2945
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#7
2946
+ class ActionCable::SubscriptionAdapter::SubscriberMap
2947
+ # @return [SubscriberMap] a new instance of SubscriberMap
2948
+ #
2949
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#8
2950
+ def initialize; end
2951
+
2952
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#49
2953
+ def add_channel(channel, on_success); end
2954
+
2955
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#13
2956
+ def add_subscriber(channel, subscriber, on_success); end
2957
+
2958
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#38
2959
+ def broadcast(channel, message); end
2960
+
2961
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#56
2962
+ def invoke_callback(callback, message); end
2963
+
2964
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#53
2965
+ def remove_channel(channel); end
2966
+
2967
+ # source://actioncable//lib/action_cable/subscription_adapter/subscriber_map.rb#27
2968
+ def remove_subscriber(channel, subscriber); end
2969
+ end
2970
+
2971
+ # ## Test adapter for Action Cable
2972
+ #
2973
+ # The test adapter should be used only in testing. Along with
2974
+ # ActionCable::TestHelper it makes a great tool to test your Rails application.
2975
+ #
2976
+ # To use the test adapter set `adapter` value to `test` in your
2977
+ # `config/cable.yml` file.
2978
+ #
2979
+ # NOTE: `Test` adapter extends the `ActionCable::SubscriptionAdapter::Async`
2980
+ # adapter, so it could be used in system tests too.
2981
+ #
2982
+ # source://actioncable//lib/action_cable/subscription_adapter/test.rb#17
2983
+ class ActionCable::SubscriptionAdapter::Test < ::ActionCable::SubscriptionAdapter::Async
2984
+ # source://actioncable//lib/action_cable/subscription_adapter/test.rb#18
2985
+ def broadcast(channel, payload); end
2986
+
2987
+ # source://actioncable//lib/action_cable/subscription_adapter/test.rb#23
2988
+ def broadcasts(channel); end
2989
+
2990
+ # source://actioncable//lib/action_cable/subscription_adapter/test.rb#31
2991
+ def clear; end
2992
+
2993
+ # source://actioncable//lib/action_cable/subscription_adapter/test.rb#27
2994
+ def clear_messages(channel); end
2995
+
2996
+ private
2997
+
2998
+ # source://actioncable//lib/action_cable/subscription_adapter/test.rb#36
2999
+ def channels_data; end
3000
+ end
3001
+
3002
+ # source://actioncable//lib/action_cable/test_case.rb#8
3003
+ class ActionCable::TestCase < ::ActiveSupport::TestCase
3004
+ include ::ActionCable::TestHelper
3005
+ end
3006
+
3007
+ # Provides helper methods for testing Action Cable broadcasting
3008
+ #
3009
+ # source://actioncable//lib/action_cable/test_helper.rb#7
3010
+ module ActionCable::TestHelper
3011
+ # source://actioncable//lib/action_cable/test_helper.rb#18
3012
+ def after_teardown; end
3013
+
3014
+ # Asserts that the specified message has been sent to the stream.
3015
+ #
3016
+ # def test_assert_transmitted_message
3017
+ # ActionCable.server.broadcast 'messages', text: 'hello'
3018
+ # assert_broadcast_on('messages', text: 'hello')
3019
+ # end
3020
+ #
3021
+ # If a block is passed, that block should cause a message with the specified
3022
+ # data to be sent.
3023
+ #
3024
+ # def test_assert_broadcast_on_again
3025
+ # assert_broadcast_on('messages', text: 'hello') do
3026
+ # ActionCable.server.broadcast 'messages', text: 'hello'
3027
+ # end
3028
+ # end
3029
+ #
3030
+ # source://actioncable//lib/action_cable/test_helper.rb#116
3031
+ def assert_broadcast_on(stream, data, &block); end
3032
+
3033
+ # Asserts that the number of broadcasted messages to the stream matches the
3034
+ # given number.
3035
+ #
3036
+ # def test_broadcasts
3037
+ # assert_broadcasts 'messages', 0
3038
+ # ActionCable.server.broadcast 'messages', { text: 'hello' }
3039
+ # assert_broadcasts 'messages', 1
3040
+ # ActionCable.server.broadcast 'messages', { text: 'world' }
3041
+ # assert_broadcasts 'messages', 2
3042
+ # end
3043
+ #
3044
+ # If a block is passed, that block should cause the specified number of messages
3045
+ # to be broadcasted.
3046
+ #
3047
+ # def test_broadcasts_again
3048
+ # assert_broadcasts('messages', 1) do
3049
+ # ActionCable.server.broadcast 'messages', { text: 'hello' }
3050
+ # end
3051
+ #
3052
+ # assert_broadcasts('messages', 2) do
3053
+ # ActionCable.server.broadcast 'messages', { text: 'hi' }
3054
+ # ActionCable.server.broadcast 'messages', { text: 'how are you?' }
3055
+ # end
3056
+ # end
3057
+ #
3058
+ # source://actioncable//lib/action_cable/test_helper.rb#48
3059
+ def assert_broadcasts(stream, number, &block); end
3060
+
3061
+ # Asserts that no messages have been sent to the stream.
3062
+ #
3063
+ # def test_no_broadcasts
3064
+ # assert_no_broadcasts 'messages'
3065
+ # ActionCable.server.broadcast 'messages', { text: 'hi' }
3066
+ # assert_broadcasts 'messages', 1
3067
+ # end
3068
+ #
3069
+ # If a block is passed, that block should not cause any message to be sent.
3070
+ #
3071
+ # def test_broadcasts_again
3072
+ # assert_no_broadcasts 'messages' do
3073
+ # # No job messages should be sent from this block
3074
+ # end
3075
+ # end
3076
+ #
3077
+ # Note: This assertion is simply a shortcut for:
3078
+ #
3079
+ # assert_broadcasts 'messages', 0, &block
3080
+ #
3081
+ # source://actioncable//lib/action_cable/test_helper.rb#80
3082
+ def assert_no_broadcasts(stream, &block); end
3083
+
3084
+ # source://actioncable//lib/action_cable/test_helper.rb#8
3085
+ def before_setup; end
3086
+
3087
+ # source://actioncable//lib/action_cable/test_helper.rb#146
3088
+ def broadcasts(*_arg0, **_arg1, &_arg2); end
3089
+
3090
+ # Returns the messages that are broadcasted in the block.
3091
+ #
3092
+ # def test_broadcasts
3093
+ # messages = capture_broadcasts('messages') do
3094
+ # ActionCable.server.broadcast 'messages', { text: 'hi' }
3095
+ # ActionCable.server.broadcast 'messages', { text: 'how are you?' }
3096
+ # end
3097
+ # assert_equal 2, messages.length
3098
+ # assert_equal({ text: 'hi' }, messages.first)
3099
+ # assert_equal({ text: 'how are you?' }, messages.last)
3100
+ # end
3101
+ #
3102
+ # source://actioncable//lib/action_cable/test_helper.rb#96
3103
+ def capture_broadcasts(stream, &block); end
3104
+
3105
+ # source://actioncable//lib/action_cable/test_helper.rb#146
3106
+ def clear_messages(*_arg0, **_arg1, &_arg2); end
3107
+
3108
+ # source://actioncable//lib/action_cable/test_helper.rb#142
3109
+ def pubsub_adapter; end
3110
+
3111
+ private
3112
+
3113
+ # source://actioncable//lib/action_cable/test_helper.rb#149
3114
+ def new_broadcasts_from(current_messages, stream, assertion, &block); end
3115
+ end
3116
+
3117
+ # source://actioncable//lib/action_cable/gem_version.rb#11
3118
+ module ActionCable::VERSION; end
3119
+
3120
+ # source://actioncable//lib/action_cable/gem_version.rb#12
3121
+ ActionCable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)
3122
+
3123
+ # source://actioncable//lib/action_cable/gem_version.rb#13
3124
+ ActionCable::VERSION::MINOR = T.let(T.unsafe(nil), Integer)
3125
+
3126
+ # source://actioncable//lib/action_cable/gem_version.rb#15
3127
+ ActionCable::VERSION::PRE = T.let(T.unsafe(nil), T.untyped)
3128
+
3129
+ # source://actioncable//lib/action_cable/gem_version.rb#17
3130
+ ActionCable::VERSION::STRING = T.let(T.unsafe(nil), String)
3131
+
3132
+ # source://actioncable//lib/action_cable/gem_version.rb#14
3133
+ ActionCable::VERSION::TINY = T.let(T.unsafe(nil), Integer)