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