rails_type_id 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +25 -0
  3. data/.ruby-version +1 -0
  4. data/README.md +46 -0
  5. data/Rakefile +16 -0
  6. data/lib/rails_type_id/concern.rb +129 -0
  7. data/lib/rails_type_id/require.rb +6 -0
  8. data/lib/rails_type_id/test_helper.rb +16 -0
  9. data/lib/rails_type_id/version.rb +6 -0
  10. data/lib/rails_type_id.rb +9 -0
  11. data/lib/tapioca/dsl/compilers/rails_type_id_compiler.rb +49 -0
  12. data/sig/rails_type_id.rbs +4 -0
  13. data/sorbet/config +4 -0
  14. data/sorbet/rbi/annotations/.gitattributes +1 -0
  15. data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
  16. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  17. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  18. data/sorbet/rbi/annotations/activejob.rbi +44 -0
  19. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  20. data/sorbet/rbi/annotations/activerecord.rbi +98 -0
  21. data/sorbet/rbi/annotations/activesupport.rbi +468 -0
  22. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  23. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  24. data/sorbet/rbi/annotations/railties.rbi +61 -0
  25. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  26. data/sorbet/rbi/dsl/.gitattributes +1 -0
  27. data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +21 -0
  28. data/sorbet/rbi/dsl/active_model/validations.rbi +26 -0
  29. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  30. data/sorbet/rbi/dsl/rails_type_id/concern.rbi +22 -0
  31. data/sorbet/rbi/gems/.gitattributes +1 -0
  32. data/sorbet/rbi/gems/actioncable@8.0.2.rbi +3133 -0
  33. data/sorbet/rbi/gems/actionmailbox@8.0.2.rbi +991 -0
  34. data/sorbet/rbi/gems/actionmailer@8.0.2.rbi +2775 -0
  35. data/sorbet/rbi/gems/actionpack@8.0.2.rbi +21167 -0
  36. data/sorbet/rbi/gems/actiontext@8.0.2.rbi +1449 -0
  37. data/sorbet/rbi/gems/actionview@8.0.2.rbi +15789 -0
  38. data/sorbet/rbi/gems/activejob@8.0.2.rbi +2864 -0
  39. data/sorbet/rbi/gems/activemodel@8.0.2.rbi +6946 -0
  40. data/sorbet/rbi/gems/activerecord@8.0.2.rbi +42458 -0
  41. data/sorbet/rbi/gems/activestorage@8.0.2.rbi +2156 -0
  42. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +21274 -0
  43. data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
  44. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  45. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  46. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +275 -0
  47. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  48. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11734 -0
  49. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
  50. data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
  51. data/sorbet/rbi/gems/date@3.4.1.rbi +403 -0
  52. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  53. data/sorbet/rbi/gems/erb@5.0.2.rbi +878 -0
  54. data/sorbet/rbi/gems/erubi@1.13.1.rbi +157 -0
  55. data/sorbet/rbi/gems/globalid@1.2.1.rbi +742 -0
  56. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2383 -0
  57. data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
  58. data/sorbet/rbi/gems/json@2.12.2.rbi +2287 -0
  59. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  60. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
  61. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  62. data/sorbet/rbi/gems/loofah@2.24.1.rbi +1105 -0
  63. data/sorbet/rbi/gems/mail@2.8.1.rbi +8890 -0
  64. data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
  65. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
  66. data/sorbet/rbi/gems/minitest@5.25.5.rbi +2231 -0
  67. data/sorbet/rbi/gems/net-imap@0.5.9.rbi +10285 -0
  68. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
  69. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
  70. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +1240 -0
  71. data/sorbet/rbi/gems/netrc@0.11.0.rbi +177 -0
  72. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +388 -0
  73. data/sorbet/rbi/gems/nokogiri@1.18.9.rbi +8548 -0
  74. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  75. data/sorbet/rbi/gems/parser@3.3.9.0.rbi +5537 -0
  76. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  77. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  78. data/sorbet/rbi/gems/prism@1.4.0.rbi +41790 -0
  79. data/sorbet/rbi/gems/psych@5.2.6.rbi +2542 -0
  80. data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
  81. data/sorbet/rbi/gems/rack-session@2.1.1.rbi +722 -0
  82. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +729 -0
  83. data/sorbet/rbi/gems/rack@3.2.0.rbi +5054 -0
  84. data/sorbet/rbi/gems/rackup@2.2.1.rbi +230 -0
  85. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +790 -0
  86. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +645 -0
  87. data/sorbet/rbi/gems/rails@8.0.2.rbi +9 -0
  88. data/sorbet/rbi/gems/railties@8.0.2.rbi +4014 -0
  89. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  90. data/sorbet/rbi/gems/rake@13.3.0.rbi +3039 -0
  91. data/sorbet/rbi/gems/rbi@0.3.6.rbi +5162 -0
  92. data/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi +7895 -0
  93. data/sorbet/rbi/gems/rdoc@6.14.2.rbi +12944 -0
  94. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3833 -0
  95. data/sorbet/rbi/gems/reline@0.6.2.rbi +9 -0
  96. data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
  97. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5205 -0
  98. data/sorbet/rbi/gems/rubocop-ast@1.46.0.rbi +7473 -0
  99. data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
  100. data/sorbet/rbi/gems/rubocop@1.79.1.rbi +63674 -0
  101. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  102. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  103. data/sorbet/rbi/gems/spoom@1.7.5.rbi +5832 -0
  104. data/sorbet/rbi/gems/sqlite3@2.7.3.rbi +1989 -0
  105. data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
  106. data/sorbet/rbi/gems/tapioca@0.17.7.rbi +3692 -0
  107. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  108. data/sorbet/rbi/gems/timeout@0.4.3.rbi +157 -0
  109. data/sorbet/rbi/gems/typeid@0.2.2.rbi +239 -0
  110. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5919 -0
  111. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  112. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  113. data/sorbet/rbi/gems/uri@1.0.3.rbi +2354 -0
  114. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  115. data/sorbet/rbi/gems/uuid7@0.2.0.rbi +60 -0
  116. data/sorbet/rbi/gems/websocket-driver@0.8.0.rbi +1065 -0
  117. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +117 -0
  118. data/sorbet/rbi/gems/with_model@2.2.0.rbi +282 -0
  119. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +430 -0
  120. data/sorbet/rbi/gems/yard@0.9.37.rbi +18512 -0
  121. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1196 -0
  122. data/sorbet/tapioca/config.yml +13 -0
  123. data/sorbet/tapioca/require.rb +13 -0
  124. metadata +208 -0
@@ -0,0 +1,2864 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `activejob` gem.
5
+ # Please instead update this file by running `bin/tapioca gem activejob`.
6
+
7
+
8
+ # :markup: markdown
9
+ # :include: ../README.md
10
+ #
11
+ # source://activejob//lib/active_job/gem_version.rb#3
12
+ module ActiveJob
13
+ extend ::ActiveSupport::Autoload
14
+
15
+ class << self
16
+ # source://activejob//lib/active_job/queue_adapter.rb#7
17
+ def adapter_name(adapter); end
18
+
19
+ # source://activejob//lib/active_job/deprecator.rb#4
20
+ def deprecator; end
21
+
22
+ # Returns the currently loaded version of Active Job as a +Gem::Version+.
23
+ #
24
+ # source://activejob//lib/active_job/gem_version.rb#5
25
+ def gem_version; end
26
+
27
+ # Push many jobs onto the queue at once without running enqueue callbacks.
28
+ # Queue adapters may communicate the enqueue status of each job by setting
29
+ # successfully_enqueued and/or enqueue_error on the passed-in job instances.
30
+ #
31
+ # source://activejob//lib/active_job/enqueuing.rb#14
32
+ def perform_all_later(*jobs); end
33
+
34
+ # source://activejob//lib/active_job.rb#57
35
+ def verbose_enqueue_logs; end
36
+
37
+ # source://activejob//lib/active_job.rb#57
38
+ def verbose_enqueue_logs=(_arg0); end
39
+
40
+ # Returns the currently loaded version of Active Job as a +Gem::Version+.
41
+ #
42
+ # source://activejob//lib/active_job/version.rb#7
43
+ def version; end
44
+
45
+ private
46
+
47
+ # source://activejob//lib/active_job/instrumentation.rb#6
48
+ def instrument_enqueue_all(queue_adapter, jobs); end
49
+ end
50
+ end
51
+
52
+ # source://activejob//lib/active_job/arguments.rb#28
53
+ module ActiveJob::Arguments
54
+ extend ::ActiveJob::Arguments
55
+
56
+ # Deserializes a set of arguments. Intrinsic types that can safely be
57
+ # deserialized without mutation are returned as-is. Arrays/Hashes are
58
+ # deserialized element by element. All other types are deserialized using
59
+ # GlobalID.
60
+ #
61
+ # source://activejob//lib/active_job/arguments.rb#42
62
+ def deserialize(arguments); end
63
+
64
+ # Serializes a set of arguments. Intrinsic types that can safely be
65
+ # serialized without mutation are returned as-is. Arrays/Hashes are
66
+ # serialized element by element. All other types are serialized using
67
+ # GlobalID.
68
+ #
69
+ # source://activejob//lib/active_job/arguments.rb#34
70
+ def serialize(arguments); end
71
+
72
+ private
73
+
74
+ # source://activejob//lib/active_job/arguments.rb#190
75
+ def convert_to_global_id_hash(argument); end
76
+
77
+ # @return [Boolean]
78
+ #
79
+ # source://activejob//lib/active_job/arguments.rb#137
80
+ def custom_serialized?(hash); end
81
+
82
+ # source://activejob//lib/active_job/arguments.rb#110
83
+ def deserialize_argument(argument); end
84
+
85
+ # source://activejob//lib/active_job/arguments.rb#133
86
+ def deserialize_global_id(hash); end
87
+
88
+ # source://activejob//lib/active_job/arguments.rb#147
89
+ def deserialize_hash(serialized_hash); end
90
+
91
+ # source://activejob//lib/active_job/arguments.rb#71
92
+ def serialize_argument(argument); end
93
+
94
+ # source://activejob//lib/active_job/arguments.rb#141
95
+ def serialize_hash(argument); end
96
+
97
+ # source://activejob//lib/active_job/arguments.rb#160
98
+ def serialize_hash_key(key); end
99
+
100
+ # source://activejob//lib/active_job/arguments.rb#171
101
+ def serialize_indifferent_hash(indifferent_hash); end
102
+
103
+ # @return [Boolean]
104
+ #
105
+ # source://activejob//lib/active_job/arguments.rb#129
106
+ def serialized_global_id?(hash); end
107
+
108
+ # source://activejob//lib/active_job/arguments.rb#177
109
+ def transform_symbol_keys(hash, symbol_keys); end
110
+ end
111
+
112
+ # source://activejob//lib/active_job/arguments.rb#50
113
+ ActiveJob::Arguments::GLOBALID_KEY = T.let(T.unsafe(nil), String)
114
+
115
+ # source://activejob//lib/active_job/arguments.rb#58
116
+ ActiveJob::Arguments::OBJECT_SERIALIZER_KEY = T.let(T.unsafe(nil), String)
117
+
118
+ # source://activejob//lib/active_job/arguments.rb#61
119
+ ActiveJob::Arguments::RESERVED_KEYS = T.let(T.unsafe(nil), Array)
120
+
121
+ # source://activejob//lib/active_job/arguments.rb#54
122
+ ActiveJob::Arguments::RUBY2_KEYWORDS_KEY = T.let(T.unsafe(nil), String)
123
+
124
+ # source://activejob//lib/active_job/arguments.rb#52
125
+ ActiveJob::Arguments::SYMBOL_KEYS_KEY = T.let(T.unsafe(nil), String)
126
+
127
+ # source://activejob//lib/active_job/arguments.rb#56
128
+ ActiveJob::Arguments::WITH_INDIFFERENT_ACCESS_KEY = T.let(T.unsafe(nil), String)
129
+
130
+ # = Active Job \Base
131
+ #
132
+ # Active Job objects can be configured to work with different backend
133
+ # queuing frameworks. To specify a queue adapter to use:
134
+ #
135
+ # ActiveJob::Base.queue_adapter = :inline
136
+ #
137
+ # A list of supported adapters can be found in QueueAdapters.
138
+ #
139
+ # Active Job objects can be defined by creating a class that inherits
140
+ # from the ActiveJob::Base class. The only necessary method to
141
+ # implement is the "perform" method.
142
+ #
143
+ # To define an Active Job object:
144
+ #
145
+ # class ProcessPhotoJob < ActiveJob::Base
146
+ # def perform(photo)
147
+ # photo.watermark!('Rails')
148
+ # photo.rotate!(90.degrees)
149
+ # photo.resize_to_fit!(300, 300)
150
+ # photo.upload!
151
+ # end
152
+ # end
153
+ #
154
+ # Records that are passed in are serialized/deserialized using Global
155
+ # ID. More information can be found in Arguments.
156
+ #
157
+ # To enqueue a job to be performed as soon as the queuing system is free:
158
+ #
159
+ # ProcessPhotoJob.perform_later(photo)
160
+ #
161
+ # To enqueue a job to be processed at some point in the future:
162
+ #
163
+ # ProcessPhotoJob.set(wait_until: Date.tomorrow.noon).perform_later(photo)
164
+ #
165
+ # More information can be found in ActiveJob::Core::ClassMethods#set
166
+ #
167
+ # A job can also be processed immediately without sending to the queue:
168
+ #
169
+ # ProcessPhotoJob.perform_now(photo)
170
+ #
171
+ # == Exceptions
172
+ #
173
+ # * DeserializationError - Error class for deserialization errors.
174
+ # * SerializationError - Error class for serialization errors.
175
+ #
176
+ # source://activejob//lib/active_job/base.rb#63
177
+ class ActiveJob::Base
178
+ include ::ActiveJob::Core
179
+ include ::ActiveJob::QueueAdapter
180
+ include ::ActiveJob::QueueName
181
+ include ::ActiveJob::QueuePriority
182
+ include ::ActiveJob::Enqueuing
183
+ include ::ActiveSupport::Rescuable
184
+ include ::ActiveJob::Execution
185
+ include ::ActiveSupport::Callbacks
186
+ include ::ActiveJob::Callbacks
187
+ include ::ActiveJob::Exceptions
188
+ include ::ActiveJob::Instrumentation
189
+ include ::ActiveJob::Logging
190
+ include ::ActiveJob::Timezones
191
+ include ::ActiveJob::Translation
192
+ include ::ActiveJob::TestHelper::TestQueueAdapter
193
+ extend ::ActiveJob::Core::ClassMethods
194
+ extend ::ActiveJob::QueueAdapter::ClassMethods
195
+ extend ::ActiveJob::QueueName::ClassMethods
196
+ extend ::ActiveJob::QueuePriority::ClassMethods
197
+ extend ::ActiveJob::Enqueuing::ClassMethods
198
+ extend ::ActiveSupport::Rescuable::ClassMethods
199
+ extend ::ActiveJob::Execution::ClassMethods
200
+ extend ::ActiveSupport::Callbacks::ClassMethods
201
+ extend ::ActiveSupport::DescendantsTracker
202
+ extend ::ActiveJob::Callbacks::ClassMethods
203
+ extend ::ActiveJob::Exceptions::ClassMethods
204
+ extend ::ActiveJob::TestHelper::TestQueueAdapter::ClassMethods
205
+
206
+ # source://activejob//lib/active_job/base.rb#70
207
+ def __callbacks; end
208
+
209
+ # source://activejob//lib/active_job/base.rb#70
210
+ def _enqueue_callbacks; end
211
+
212
+ # source://activejob//lib/active_job/base.rb#70
213
+ def _perform_callbacks; end
214
+
215
+ # source://activejob//lib/active_job/base.rb#70
216
+ def _run_enqueue_callbacks(&block); end
217
+
218
+ # source://activejob//lib/active_job/base.rb#70
219
+ def _run_perform_callbacks(&block); end
220
+
221
+ # source://activejob//lib/active_job/base.rb#71
222
+ def after_discard_procs; end
223
+
224
+ # source://activejob//lib/active_job/base.rb#71
225
+ def after_discard_procs=(_arg0); end
226
+
227
+ # source://activejob//lib/active_job/base.rb#71
228
+ def after_discard_procs?; end
229
+
230
+ # source://activejob//lib/active_job/base.rb#73
231
+ def logger; end
232
+
233
+ # source://activejob//lib/active_job/base.rb#73
234
+ def logger=(val); end
235
+
236
+ # source://activejob//lib/active_job/base.rb#65
237
+ def queue_adapter(&_arg0); end
238
+
239
+ # source://activejob//lib/active_job/base.rb#66
240
+ def queue_name_prefix; end
241
+
242
+ # source://activejob//lib/active_job/base.rb#66
243
+ def queue_name_prefix=(_arg0); end
244
+
245
+ # source://activejob//lib/active_job/base.rb#66
246
+ def queue_name_prefix?; end
247
+
248
+ # source://activejob//lib/active_job/base.rb#69
249
+ def rescue_handlers; end
250
+
251
+ # source://activejob//lib/active_job/base.rb#69
252
+ def rescue_handlers=(_arg0); end
253
+
254
+ # source://activejob//lib/active_job/base.rb#69
255
+ def rescue_handlers?; end
256
+
257
+ class << self
258
+ # source://activejob//lib/active_job/base.rb#70
259
+ def __callbacks; end
260
+
261
+ # source://activejob//lib/active_job/base.rb#70
262
+ def __callbacks=(value); end
263
+
264
+ # source://activejob//lib/active_job/base.rb#70
265
+ def _enqueue_callbacks; end
266
+
267
+ # source://activejob//lib/active_job/base.rb#70
268
+ def _enqueue_callbacks=(value); end
269
+
270
+ # source://activejob//lib/active_job/base.rb#70
271
+ def _perform_callbacks; end
272
+
273
+ # source://activejob//lib/active_job/base.rb#70
274
+ def _perform_callbacks=(value); end
275
+
276
+ # source://activejob//lib/active_job/base.rb#65
277
+ def _queue_adapter; end
278
+
279
+ # source://activejob//lib/active_job/base.rb#65
280
+ def _queue_adapter=(value); end
281
+
282
+ # source://activejob//lib/active_job/base.rb#65
283
+ def _queue_adapter_name; end
284
+
285
+ # source://activejob//lib/active_job/base.rb#65
286
+ def _queue_adapter_name=(value); end
287
+
288
+ # source://activejob//lib/active_job/test_helper.rb#19
289
+ def _test_adapter; end
290
+
291
+ # source://activejob//lib/active_job/test_helper.rb#19
292
+ def _test_adapter=(value); end
293
+
294
+ # source://activejob//lib/active_job/base.rb#71
295
+ def after_discard_procs; end
296
+
297
+ # source://activejob//lib/active_job/base.rb#71
298
+ def after_discard_procs=(value); end
299
+
300
+ # source://activejob//lib/active_job/base.rb#71
301
+ def after_discard_procs?; end
302
+
303
+ # source://activejob//lib/active_job/base.rb#68
304
+ def enqueue_after_transaction_commit; end
305
+
306
+ # source://activejob//lib/active_job/base.rb#68
307
+ def enqueue_after_transaction_commit=(value); end
308
+
309
+ # source://activejob//lib/active_job/base.rb#73
310
+ def log_arguments; end
311
+
312
+ # source://activejob//lib/active_job/base.rb#73
313
+ def log_arguments=(value); end
314
+
315
+ # source://activejob//lib/active_job/base.rb#73
316
+ def log_arguments?; end
317
+
318
+ # source://activejob//lib/active_job/base.rb#73
319
+ def logger; end
320
+
321
+ # source://activejob//lib/active_job/base.rb#73
322
+ def logger=(val); end
323
+
324
+ # source://activejob//lib/active_job/base.rb#67
325
+ def priority; end
326
+
327
+ # source://activejob//lib/active_job/base.rb#67
328
+ def priority=(value); end
329
+
330
+ # source://activejob//lib/active_job/base.rb#67
331
+ def priority?; end
332
+
333
+ # source://activejob//lib/active_job/base.rb#66
334
+ def queue_name; end
335
+
336
+ # source://activejob//lib/active_job/base.rb#66
337
+ def queue_name=(value); end
338
+
339
+ # source://activejob//lib/active_job/base.rb#66
340
+ def queue_name?; end
341
+
342
+ # source://activejob//lib/active_job/base.rb#66
343
+ def queue_name_delimiter; end
344
+
345
+ # source://activejob//lib/active_job/base.rb#66
346
+ def queue_name_delimiter=(value); end
347
+
348
+ # source://activejob//lib/active_job/base.rb#66
349
+ def queue_name_delimiter?; end
350
+
351
+ # source://activejob//lib/active_job/base.rb#66
352
+ def queue_name_prefix; end
353
+
354
+ # source://activejob//lib/active_job/base.rb#66
355
+ def queue_name_prefix=(value); end
356
+
357
+ # source://activejob//lib/active_job/base.rb#66
358
+ def queue_name_prefix?; end
359
+
360
+ # source://activejob//lib/active_job/base.rb#69
361
+ def rescue_handlers; end
362
+
363
+ # source://activejob//lib/active_job/base.rb#69
364
+ def rescue_handlers=(value); end
365
+
366
+ # source://activejob//lib/active_job/base.rb#69
367
+ def rescue_handlers?; end
368
+
369
+ # source://activejob//lib/active_job/base.rb#71
370
+ def retry_jitter; end
371
+
372
+ # source://activejob//lib/active_job/base.rb#71
373
+ def retry_jitter=(value); end
374
+
375
+ private
376
+
377
+ # source://activejob//lib/active_job/base.rb#70
378
+ def __class_attr___callbacks; end
379
+
380
+ # source://activejob//lib/active_job/base.rb#70
381
+ def __class_attr___callbacks=(new_value); end
382
+
383
+ # source://activejob//lib/active_job/base.rb#65
384
+ def __class_attr__queue_adapter; end
385
+
386
+ # source://activejob//lib/active_job/base.rb#65
387
+ def __class_attr__queue_adapter=(new_value); end
388
+
389
+ # source://activejob//lib/active_job/base.rb#65
390
+ def __class_attr__queue_adapter_name; end
391
+
392
+ # source://activejob//lib/active_job/base.rb#65
393
+ def __class_attr__queue_adapter_name=(new_value); end
394
+
395
+ # source://activejob//lib/active_job/test_helper.rb#19
396
+ def __class_attr__test_adapter; end
397
+
398
+ # source://activejob//lib/active_job/test_helper.rb#19
399
+ def __class_attr__test_adapter=(new_value); end
400
+
401
+ # source://activejob//lib/active_job/base.rb#71
402
+ def __class_attr_after_discard_procs; end
403
+
404
+ # source://activejob//lib/active_job/base.rb#71
405
+ def __class_attr_after_discard_procs=(new_value); end
406
+
407
+ # source://activejob//lib/active_job/base.rb#68
408
+ def __class_attr_enqueue_after_transaction_commit; end
409
+
410
+ # source://activejob//lib/active_job/base.rb#68
411
+ def __class_attr_enqueue_after_transaction_commit=(new_value); end
412
+
413
+ # source://activejob//lib/active_job/base.rb#73
414
+ def __class_attr_log_arguments; end
415
+
416
+ # source://activejob//lib/active_job/base.rb#73
417
+ def __class_attr_log_arguments=(new_value); end
418
+
419
+ # source://activejob//lib/active_job/base.rb#67
420
+ def __class_attr_priority; end
421
+
422
+ # source://activejob//lib/active_job/base.rb#67
423
+ def __class_attr_priority=(new_value); end
424
+
425
+ # source://activejob//lib/active_job/base.rb#66
426
+ def __class_attr_queue_name; end
427
+
428
+ # source://activejob//lib/active_job/base.rb#66
429
+ def __class_attr_queue_name=(new_value); end
430
+
431
+ # source://activejob//lib/active_job/base.rb#66
432
+ def __class_attr_queue_name_delimiter; end
433
+
434
+ # source://activejob//lib/active_job/base.rb#66
435
+ def __class_attr_queue_name_delimiter=(new_value); end
436
+
437
+ # source://activejob//lib/active_job/base.rb#66
438
+ def __class_attr_queue_name_prefix; end
439
+
440
+ # source://activejob//lib/active_job/base.rb#66
441
+ def __class_attr_queue_name_prefix=(new_value); end
442
+
443
+ # source://activejob//lib/active_job/base.rb#69
444
+ def __class_attr_rescue_handlers; end
445
+
446
+ # source://activejob//lib/active_job/base.rb#69
447
+ def __class_attr_rescue_handlers=(new_value); end
448
+
449
+ # source://activejob//lib/active_job/base.rb#71
450
+ def __class_attr_retry_jitter; end
451
+
452
+ # source://activejob//lib/active_job/base.rb#71
453
+ def __class_attr_retry_jitter=(new_value); end
454
+ end
455
+ end
456
+
457
+ # = Active Job \Callbacks
458
+ #
459
+ # Active Job provides hooks during the life cycle of a job. Callbacks allow you
460
+ # to trigger logic during this cycle. Available callbacks are:
461
+ #
462
+ # * <tt>before_enqueue</tt>
463
+ # * <tt>around_enqueue</tt>
464
+ # * <tt>after_enqueue</tt>
465
+ # * <tt>before_perform</tt>
466
+ # * <tt>around_perform</tt>
467
+ # * <tt>after_perform</tt>
468
+ #
469
+ # source://activejob//lib/active_job/callbacks.rb#18
470
+ module ActiveJob::Callbacks
471
+ extend ::ActiveSupport::Concern
472
+ extend ::ActiveSupport::Callbacks
473
+ include GeneratedInstanceMethods
474
+ include ::ActiveSupport::Callbacks
475
+
476
+ mixes_in_class_methods GeneratedClassMethods
477
+ mixes_in_class_methods ::ActiveSupport::Callbacks::ClassMethods
478
+ mixes_in_class_methods ::ActiveSupport::DescendantsTracker
479
+ mixes_in_class_methods ::ActiveJob::Callbacks::ClassMethods
480
+
481
+ class << self
482
+ # source://activejob//lib/active_job/callbacks.rb#23
483
+ def __callbacks; end
484
+
485
+ # source://activejob//lib/active_job/callbacks.rb#23
486
+ def __callbacks=(value); end
487
+
488
+ # source://activejob//lib/active_job/callbacks.rb#24
489
+ def _execute_callbacks; end
490
+
491
+ # source://activejob//lib/active_job/callbacks.rb#24
492
+ def _run_execute_callbacks(&block); end
493
+
494
+ private
495
+
496
+ # source://activejob//lib/active_job/callbacks.rb#23
497
+ def __class_attr___callbacks; end
498
+ end
499
+
500
+ module GeneratedClassMethods
501
+ def __callbacks; end
502
+ def __callbacks=(value); end
503
+ end
504
+
505
+ module GeneratedInstanceMethods
506
+ def __callbacks; end
507
+ end
508
+ end
509
+
510
+ # These methods will be included into any Active Job object, adding
511
+ # callbacks for +perform+ and +enqueue+ methods.
512
+ #
513
+ # source://activejob//lib/active_job/callbacks.rb#34
514
+ module ActiveJob::Callbacks::ClassMethods
515
+ # Defines a callback that will get called right after the
516
+ # job is enqueued.
517
+ #
518
+ # class VideoProcessJob < ActiveJob::Base
519
+ # queue_as :default
520
+ #
521
+ # after_enqueue do |job|
522
+ # result = job.successfully_enqueued? ? "success" : "failure"
523
+ # $statsd.increment "enqueue-video-job.#{result}"
524
+ # end
525
+ #
526
+ # def perform(video_id)
527
+ # Video.find(video_id).process
528
+ # end
529
+ # end
530
+ #
531
+ # source://activejob//lib/active_job/callbacks.rb#141
532
+ def after_enqueue(*filters, &blk); end
533
+
534
+ # Defines a callback that will get called right after the
535
+ # job's perform method has finished.
536
+ #
537
+ # class VideoProcessJob < ActiveJob::Base
538
+ # queue_as :default
539
+ #
540
+ # after_perform do |job|
541
+ # UserMailer.notify_video_processed(job.arguments.first)
542
+ # end
543
+ #
544
+ # def perform(video_id)
545
+ # Video.find(video_id).process
546
+ # end
547
+ # end
548
+ #
549
+ # source://activejob//lib/active_job/callbacks.rb#69
550
+ def after_perform(*filters, &blk); end
551
+
552
+ # Defines a callback that will get called around the enqueuing
553
+ # of the job.
554
+ #
555
+ # class VideoProcessJob < ActiveJob::Base
556
+ # queue_as :default
557
+ #
558
+ # around_enqueue do |job, block|
559
+ # $statsd.time "video-job.process" do
560
+ # block.call
561
+ # end
562
+ # end
563
+ #
564
+ # def perform(video_id)
565
+ # Video.find(video_id).process
566
+ # end
567
+ # end
568
+ #
569
+ # source://activejob//lib/active_job/callbacks.rb#162
570
+ def around_enqueue(*filters, &blk); end
571
+
572
+ # Defines a callback that will get called around the job's perform method.
573
+ #
574
+ # class VideoProcessJob < ActiveJob::Base
575
+ # queue_as :default
576
+ #
577
+ # around_perform do |job, block|
578
+ # UserMailer.notify_video_started_processing(job.arguments.first)
579
+ # block.call
580
+ # UserMailer.notify_video_processed(job.arguments.first)
581
+ # end
582
+ #
583
+ # def perform(video_id)
584
+ # Video.find(video_id).process
585
+ # end
586
+ # end
587
+ #
588
+ # You can access the return value of the job only if the execution wasn't halted.
589
+ #
590
+ # class VideoProcessJob < ActiveJob::Base
591
+ # around_perform do |job, block|
592
+ # value = block.call
593
+ # puts value # => "Hello World!"
594
+ # end
595
+ #
596
+ # def perform
597
+ # "Hello World!"
598
+ # end
599
+ # end
600
+ #
601
+ # source://activejob//lib/active_job/callbacks.rb#102
602
+ def around_perform(*filters, &blk); end
603
+
604
+ # Defines a callback that will get called right before the
605
+ # job is enqueued.
606
+ #
607
+ # class VideoProcessJob < ActiveJob::Base
608
+ # queue_as :default
609
+ #
610
+ # before_enqueue do |job|
611
+ # $statsd.increment "enqueue-video-job.try"
612
+ # end
613
+ #
614
+ # def perform(video_id)
615
+ # Video.find(video_id).process
616
+ # end
617
+ # end
618
+ #
619
+ # source://activejob//lib/active_job/callbacks.rb#121
620
+ def before_enqueue(*filters, &blk); end
621
+
622
+ # Defines a callback that will get called right before the
623
+ # job's perform method is executed.
624
+ #
625
+ # class VideoProcessJob < ActiveJob::Base
626
+ # queue_as :default
627
+ #
628
+ # before_perform do |job|
629
+ # UserMailer.notify_video_started_processing(job.arguments.first)
630
+ # end
631
+ #
632
+ # def perform(video_id)
633
+ # Video.find(video_id).process
634
+ # end
635
+ # end
636
+ #
637
+ # source://activejob//lib/active_job/callbacks.rb#50
638
+ def before_perform(*filters, &blk); end
639
+ end
640
+
641
+ # source://activejob//lib/active_job/configured_job.rb#4
642
+ class ActiveJob::ConfiguredJob
643
+ # @return [ConfiguredJob] a new instance of ConfiguredJob
644
+ #
645
+ # source://activejob//lib/active_job/configured_job.rb#5
646
+ def initialize(job_class, options = T.unsafe(nil)); end
647
+
648
+ # source://activejob//lib/active_job/configured_job.rb#18
649
+ def perform_all_later(multi_args); end
650
+
651
+ # source://activejob//lib/active_job/configured_job.rb#14
652
+ def perform_later(*_arg0, **_arg1, &_arg2); end
653
+
654
+ # source://activejob//lib/active_job/configured_job.rb#10
655
+ def perform_now(*_arg0, **_arg1, &_arg2); end
656
+ end
657
+
658
+ # = Active Job \Core
659
+ #
660
+ # Provides general behavior that will be included into every Active Job
661
+ # object that inherits from ActiveJob::Base.
662
+ #
663
+ # source://activejob//lib/active_job/core.rb#8
664
+ module ActiveJob::Core
665
+ extend ::ActiveSupport::Concern
666
+
667
+ mixes_in_class_methods ::ActiveJob::Core::ClassMethods
668
+
669
+ # Creates a new job instance. Takes the arguments that will be
670
+ # passed to the perform method.
671
+ #
672
+ # source://activejob//lib/active_job/core.rb#93
673
+ def initialize(*arguments, **_arg1); end
674
+
675
+ # Job arguments
676
+ #
677
+ # source://activejob//lib/active_job/core.rb#12
678
+ def arguments; end
679
+
680
+ # Job arguments
681
+ #
682
+ # source://activejob//lib/active_job/core.rb#12
683
+ def arguments=(_arg0); end
684
+
685
+ # Attaches the stored job data to the current instance. Receives a hash
686
+ # returned from +serialize+
687
+ #
688
+ # ==== Examples
689
+ #
690
+ # class DeliverWebhookJob < ActiveJob::Base
691
+ # attr_writer :attempt_number
692
+ #
693
+ # def attempt_number
694
+ # @attempt_number ||= 0
695
+ # end
696
+ #
697
+ # def serialize
698
+ # super.merge('attempt_number' => attempt_number + 1)
699
+ # end
700
+ #
701
+ # def deserialize(job_data)
702
+ # super
703
+ # self.attempt_number = job_data['attempt_number']
704
+ # end
705
+ #
706
+ # rescue_from(Timeout::Error) do |exception|
707
+ # raise exception if attempt_number > 5
708
+ # retry_job(wait: 10)
709
+ # end
710
+ # end
711
+ #
712
+ # source://activejob//lib/active_job/core.rb#150
713
+ def deserialize(job_data); end
714
+
715
+ # Track any exceptions raised by the backend so callers can inspect the errors.
716
+ #
717
+ # source://activejob//lib/active_job/core.rb#56
718
+ def enqueue_error; end
719
+
720
+ # Track any exceptions raised by the backend so callers can inspect the errors.
721
+ #
722
+ # source://activejob//lib/active_job/core.rb#56
723
+ def enqueue_error=(_arg0); end
724
+
725
+ # Track when a job was enqueued
726
+ #
727
+ # source://activejob//lib/active_job/core.rb#46
728
+ def enqueued_at; end
729
+
730
+ # Track when a job was enqueued
731
+ #
732
+ # source://activejob//lib/active_job/core.rb#46
733
+ def enqueued_at=(_arg0); end
734
+
735
+ # Hash that contains the number of times this job handled errors for each specific retry_on declaration.
736
+ # Keys are the string representation of the exceptions listed in the retry_on declaration,
737
+ # while its associated value holds the number of executions where the corresponding retry_on
738
+ # declaration handled one of its listed exceptions.
739
+ #
740
+ # source://activejob//lib/active_job/core.rb#37
741
+ def exception_executions; end
742
+
743
+ # Hash that contains the number of times this job handled errors for each specific retry_on declaration.
744
+ # Keys are the string representation of the exceptions listed in the retry_on declaration,
745
+ # while its associated value holds the number of executions where the corresponding retry_on
746
+ # declaration handled one of its listed exceptions.
747
+ #
748
+ # source://activejob//lib/active_job/core.rb#37
749
+ def exception_executions=(_arg0); end
750
+
751
+ # Number of times this job has been executed (which increments on every retry, like after an exception).
752
+ #
753
+ # source://activejob//lib/active_job/core.rb#31
754
+ def executions; end
755
+
756
+ # Number of times this job has been executed (which increments on every retry, like after an exception).
757
+ #
758
+ # source://activejob//lib/active_job/core.rb#31
759
+ def executions=(_arg0); end
760
+
761
+ # Job Identifier
762
+ #
763
+ # source://activejob//lib/active_job/core.rb#19
764
+ def job_id; end
765
+
766
+ # Job Identifier
767
+ #
768
+ # source://activejob//lib/active_job/core.rb#19
769
+ def job_id=(_arg0); end
770
+
771
+ # I18n.locale to be used during the job.
772
+ #
773
+ # source://activejob//lib/active_job/core.rb#40
774
+ def locale; end
775
+
776
+ # I18n.locale to be used during the job.
777
+ #
778
+ # source://activejob//lib/active_job/core.rb#40
779
+ def locale=(_arg0); end
780
+
781
+ # Priority that the job will have (lower is more priority).
782
+ #
783
+ # source://activejob//lib/active_job/core.rb#25
784
+ def priority=(_arg0); end
785
+
786
+ # ID optionally provided by adapter
787
+ #
788
+ # source://activejob//lib/active_job/core.rb#28
789
+ def provider_job_id; end
790
+
791
+ # ID optionally provided by adapter
792
+ #
793
+ # source://activejob//lib/active_job/core.rb#28
794
+ def provider_job_id=(_arg0); end
795
+
796
+ # Queue in which the job will reside.
797
+ #
798
+ # source://activejob//lib/active_job/core.rb#22
799
+ def queue_name=(_arg0); end
800
+
801
+ # Time when the job should be performed
802
+ #
803
+ # source://activejob//lib/active_job/core.rb#16
804
+ def scheduled_at; end
805
+
806
+ # Time when the job should be performed
807
+ #
808
+ # source://activejob//lib/active_job/core.rb#16
809
+ def scheduled_at=(_arg0); end
810
+
811
+ # Returns a hash with the job data that can safely be passed to the
812
+ # queuing adapter.
813
+ #
814
+ # source://activejob//lib/active_job/core.rb#107
815
+ def serialize; end
816
+
817
+ # Sets the attribute serialized_arguments
818
+ #
819
+ # @param value the value to set the attribute serialized_arguments to.
820
+ #
821
+ # source://activejob//lib/active_job/core.rb#13
822
+ def serialized_arguments=(_arg0); end
823
+
824
+ # Configures the job with the given options.
825
+ #
826
+ # source://activejob//lib/active_job/core.rb#165
827
+ def set(options = T.unsafe(nil)); end
828
+
829
+ # Track whether the adapter received the job successfully.
830
+ #
831
+ # source://activejob//lib/active_job/core.rb#49
832
+ def successfully_enqueued=(_arg0); end
833
+
834
+ # @return [Boolean]
835
+ #
836
+ # source://activejob//lib/active_job/core.rb#51
837
+ def successfully_enqueued?; end
838
+
839
+ # Timezone to be used during the job.
840
+ #
841
+ # source://activejob//lib/active_job/core.rb#43
842
+ def timezone; end
843
+
844
+ # Timezone to be used during the job.
845
+ #
846
+ # source://activejob//lib/active_job/core.rb#43
847
+ def timezone=(_arg0); end
848
+
849
+ private
850
+
851
+ # @return [Boolean]
852
+ #
853
+ # source://activejob//lib/active_job/core.rb#198
854
+ def arguments_serialized?; end
855
+
856
+ # source://activejob//lib/active_job/core.rb#194
857
+ def deserialize_arguments(serialized_args); end
858
+
859
+ # source://activejob//lib/active_job/core.rb#183
860
+ def deserialize_arguments_if_needed; end
861
+
862
+ # source://activejob//lib/active_job/core.rb#190
863
+ def serialize_arguments(arguments); end
864
+
865
+ # source://activejob//lib/active_job/core.rb#175
866
+ def serialize_arguments_if_needed(arguments); end
867
+ end
868
+
869
+ # These methods will be included into any Active Job object, adding
870
+ # helpers for de/serialization and creation of job instances.
871
+ #
872
+ # source://activejob//lib/active_job/core.rb#60
873
+ module ActiveJob::Core::ClassMethods
874
+ # Creates a new job instance from a hash created with +serialize+
875
+ #
876
+ # source://activejob//lib/active_job/core.rb#62
877
+ def deserialize(job_data); end
878
+
879
+ # Creates a job preconfigured with the given options. You can call
880
+ # perform_later with the job arguments to enqueue the job with the
881
+ # preconfigured options
882
+ #
883
+ # ==== Options
884
+ # * <tt>:wait</tt> - Enqueues the job with the specified delay
885
+ # * <tt>:wait_until</tt> - Enqueues the job at the time specified
886
+ # * <tt>:queue</tt> - Enqueues the job on the specified queue
887
+ # * <tt>:priority</tt> - Enqueues the job with the specified priority
888
+ #
889
+ # ==== Examples
890
+ #
891
+ # VideoJob.set(queue: :some_queue).perform_later(Video.last)
892
+ # VideoJob.set(wait: 5.minutes).perform_later(Video.last)
893
+ # VideoJob.set(wait_until: Time.now.tomorrow).perform_later(Video.last)
894
+ # VideoJob.set(queue: :some_queue, wait: 5.minutes).perform_later(Video.last)
895
+ # VideoJob.set(queue: :some_queue, wait_until: Time.now.tomorrow).perform_later(Video.last)
896
+ # VideoJob.set(queue: :some_queue, wait: 5.minutes, priority: 10).perform_later(Video.last)
897
+ #
898
+ # source://activejob//lib/active_job/core.rb#86
899
+ def set(options = T.unsafe(nil)); end
900
+ end
901
+
902
+ # Raised when an exception is raised during job arguments deserialization.
903
+ #
904
+ # Wraps the original exception raised as +cause+.
905
+ #
906
+ # source://activejob//lib/active_job/arguments.rb#10
907
+ class ActiveJob::DeserializationError < ::StandardError
908
+ # @return [DeserializationError] a new instance of DeserializationError
909
+ #
910
+ # source://activejob//lib/active_job/arguments.rb#11
911
+ def initialize; end
912
+ end
913
+
914
+ # source://activejob//lib/active_job/enqueue_after_transaction_commit.rb#4
915
+ module ActiveJob::EnqueueAfterTransactionCommit
916
+ private
917
+
918
+ # source://activejob//lib/active_job/enqueue_after_transaction_commit.rb#6
919
+ def raw_enqueue; end
920
+ end
921
+
922
+ # Can be raised by adapters if they wish to communicate to the caller a reason
923
+ # why the adapter was unexpectedly unable to enqueue a job.
924
+ #
925
+ # source://activejob//lib/active_job/enqueuing.rb#8
926
+ class ActiveJob::EnqueueError < ::StandardError; end
927
+
928
+ # source://activejob//lib/active_job/enqueuing.rb#40
929
+ module ActiveJob::Enqueuing
930
+ extend ::ActiveSupport::Concern
931
+ include GeneratedInstanceMethods
932
+
933
+ mixes_in_class_methods GeneratedClassMethods
934
+ mixes_in_class_methods ::ActiveJob::Enqueuing::ClassMethods
935
+
936
+ # Enqueues the job to be performed by the queue adapter.
937
+ #
938
+ # ==== Options
939
+ # * <tt>:wait</tt> - Enqueues the job with the specified delay
940
+ # * <tt>:wait_until</tt> - Enqueues the job at the time specified
941
+ # * <tt>:queue</tt> - Enqueues the job on the specified queue
942
+ # * <tt>:priority</tt> - Enqueues the job with the specified priority
943
+ #
944
+ # ==== Examples
945
+ #
946
+ # my_job_instance.enqueue
947
+ # my_job_instance.enqueue wait: 5.minutes
948
+ # my_job_instance.enqueue queue: :important
949
+ # my_job_instance.enqueue wait_until: Date.tomorrow.midnight
950
+ # my_job_instance.enqueue priority: 10
951
+ #
952
+ # source://activejob//lib/active_job/enqueuing.rb#112
953
+ def enqueue(options = T.unsafe(nil)); end
954
+
955
+ private
956
+
957
+ # source://activejob//lib/active_job/enqueuing.rb#128
958
+ def raw_enqueue; end
959
+
960
+ module GeneratedClassMethods
961
+ def enqueue_after_transaction_commit; end
962
+ def enqueue_after_transaction_commit=(value); end
963
+ end
964
+
965
+ module GeneratedInstanceMethods; end
966
+ end
967
+
968
+ # Includes the +perform_later+ method for job initialization.
969
+ #
970
+ # source://activejob//lib/active_job/enqueuing.rb#57
971
+ module ActiveJob::Enqueuing::ClassMethods
972
+ # Push a job onto the queue. By default the arguments must be either String,
973
+ # Integer, Float, NilClass, TrueClass, FalseClass, BigDecimal, Symbol, Date,
974
+ # Time, DateTime, ActiveSupport::TimeWithZone, ActiveSupport::Duration,
975
+ # Hash, ActiveSupport::HashWithIndifferentAccess, Array, Range, or
976
+ # GlobalID::Identification instances, although this can be extended by adding
977
+ # custom serializers.
978
+ #
979
+ # Returns an instance of the job class queued with arguments available in
980
+ # Job#arguments or +false+ if the enqueue did not succeed.
981
+ #
982
+ # After the attempted enqueue, the job will be yielded to an optional block.
983
+ #
984
+ # If Active Job is used conjointly with Active Record, and #perform_later is called
985
+ # inside an Active Record transaction, then the enqueue is implicitly deferred to after
986
+ # the transaction is committed, or dropped if it's rolled back. In such case #perform_later
987
+ # will return the job instance like if it was successfully enqueued, but will still return
988
+ # +false+ if a callback prevented the job from being enqueued.
989
+ #
990
+ # This behavior can be changed on a per job basis:
991
+ #
992
+ # class NotificationJob < ApplicationJob
993
+ # self.enqueue_after_transaction_commit = false
994
+ # end
995
+ #
996
+ # @yield [job]
997
+ #
998
+ # source://activejob//lib/active_job/enqueuing.rb#81
999
+ def perform_later(*_arg0, **_arg1, &_arg2); end
1000
+
1001
+ private
1002
+
1003
+ # source://activejob//lib/active_job/enqueuing.rb#91
1004
+ def job_or_instantiate(*args, **_arg1, &_); end
1005
+ end
1006
+
1007
+ # Provides behavior for retrying and discarding jobs on exceptions.
1008
+ #
1009
+ # source://activejob//lib/active_job/exceptions.rb#7
1010
+ module ActiveJob::Exceptions
1011
+ extend ::ActiveSupport::Concern
1012
+ include GeneratedInstanceMethods
1013
+
1014
+ mixes_in_class_methods GeneratedClassMethods
1015
+ mixes_in_class_methods ::ActiveJob::Exceptions::ClassMethods
1016
+
1017
+ # Reschedules the job to be re-executed. This is useful in combination with
1018
+ # {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from].
1019
+ # When you rescue an exception from your job you can ask Active Job to retry
1020
+ # performing your job.
1021
+ #
1022
+ # ==== Options
1023
+ # * <tt>:wait</tt> - Enqueues the job with the specified delay in seconds
1024
+ # * <tt>:wait_until</tt> - Enqueues the job at the time specified
1025
+ # * <tt>:queue</tt> - Enqueues the job on the specified queue
1026
+ # * <tt>:priority</tt> - Enqueues the job with the specified priority
1027
+ #
1028
+ # ==== Examples
1029
+ #
1030
+ # class SiteScraperJob < ActiveJob::Base
1031
+ # rescue_from(ErrorLoadingSite) do
1032
+ # retry_job queue: :low_priority
1033
+ # end
1034
+ #
1035
+ # def perform(*args)
1036
+ # # raise ErrorLoadingSite if cannot scrape
1037
+ # end
1038
+ # end
1039
+ #
1040
+ # source://activejob//lib/active_job/exceptions.rb#151
1041
+ def retry_job(options = T.unsafe(nil)); end
1042
+
1043
+ private
1044
+
1045
+ # source://activejob//lib/active_job/exceptions.rb#161
1046
+ def determine_delay(seconds_or_duration_or_algorithm:, executions:, jitter: T.unsafe(nil)); end
1047
+
1048
+ # source://activejob//lib/active_job/exceptions.rb#182
1049
+ def determine_jitter_for_delay(delay, jitter); end
1050
+
1051
+ # source://activejob//lib/active_job/exceptions.rb#187
1052
+ def executions_for(exceptions); end
1053
+
1054
+ # source://activejob//lib/active_job/exceptions.rb#196
1055
+ def run_after_discard_procs(exception); end
1056
+
1057
+ module GeneratedClassMethods
1058
+ def after_discard_procs; end
1059
+ def after_discard_procs=(value); end
1060
+ def after_discard_procs?; end
1061
+ def retry_jitter; end
1062
+ def retry_jitter=(value); end
1063
+ end
1064
+
1065
+ module GeneratedInstanceMethods
1066
+ def after_discard_procs; end
1067
+ def after_discard_procs=(value); end
1068
+ def after_discard_procs?; end
1069
+ end
1070
+ end
1071
+
1072
+ # source://activejob//lib/active_job/exceptions.rb#15
1073
+ module ActiveJob::Exceptions::ClassMethods
1074
+ # A block to run when a job is about to be discarded for any reason.
1075
+ #
1076
+ # ==== Example
1077
+ #
1078
+ # class WorkJob < ActiveJob::Base
1079
+ # after_discard do |job, exception|
1080
+ # ExceptionNotifier.report(exception)
1081
+ # end
1082
+ #
1083
+ # ...
1084
+ #
1085
+ # end
1086
+ #
1087
+ # source://activejob//lib/active_job/exceptions.rb#124
1088
+ def after_discard(&blk); end
1089
+
1090
+ # Discard the job with no attempts to retry, if the exception is raised. This is useful when the subject of the job,
1091
+ # like an Active Record, is no longer available, and the job is thus no longer relevant.
1092
+ #
1093
+ # You can also pass a block that'll be invoked. This block is yielded with the job instance as the first and the error instance as the second parameter.
1094
+ #
1095
+ # +retry_on+ and +discard_on+ handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for
1096
+ # which <tt>exception.is_a?(klass)</tt> holds true is the one invoked, if any.
1097
+ #
1098
+ # ==== Example
1099
+ #
1100
+ # class SearchIndexingJob < ActiveJob::Base
1101
+ # discard_on ActiveJob::DeserializationError
1102
+ # discard_on(CustomAppException) do |job, error|
1103
+ # ExceptionNotifier.caught(error)
1104
+ # end
1105
+ #
1106
+ # def perform(record)
1107
+ # # Will raise ActiveJob::DeserializationError if the record can't be deserialized
1108
+ # # Might raise CustomAppException for something domain specific
1109
+ # end
1110
+ # end
1111
+ #
1112
+ # source://activejob//lib/active_job/exceptions.rb#103
1113
+ def discard_on(*exceptions); end
1114
+
1115
+ # Catch the exception and reschedule job for re-execution after so many seconds, for a specific number of attempts.
1116
+ # If the exception keeps getting raised beyond the specified number of attempts, the exception is allowed to
1117
+ # bubble up to the underlying queuing system, which may have its own retry mechanism or place it in a
1118
+ # holding queue for inspection.
1119
+ #
1120
+ # You can also pass a block that'll be invoked if the retry attempts fail for custom logic rather than letting
1121
+ # the exception bubble up. This block is yielded with the job instance as the first and the error instance as the second parameter.
1122
+ #
1123
+ # +retry_on+ and +discard_on+ handlers are searched from bottom to top, and up the class hierarchy. The handler of the first class for
1124
+ # which <tt>exception.is_a?(klass)</tt> holds true is the one invoked, if any.
1125
+ #
1126
+ # ==== Options
1127
+ # * <tt>:wait</tt> - Re-enqueues the job with a delay specified either in seconds (default: 3 seconds),
1128
+ # as a computing proc that takes the number of executions so far as an argument, or as a symbol reference of
1129
+ # <tt>:polynomially_longer</tt>, which applies the wait algorithm of <tt>((executions**4) + (Kernel.rand * (executions**4) * jitter)) + 2</tt>
1130
+ # (first wait ~3s, then ~18s, then ~83s, etc)
1131
+ # * <tt>:attempts</tt> - Enqueues the job the specified number of times (default: 5 attempts) or a symbol reference of <tt>:unlimited</tt>
1132
+ # to retry the job until it succeeds. The number of attempts includes the original job execution.
1133
+ # * <tt>:queue</tt> - Re-enqueues the job on a different queue
1134
+ # * <tt>:priority</tt> - Re-enqueues the job with a different priority
1135
+ # * <tt>:jitter</tt> - A random delay of wait time used when calculating backoff. The default is 15% (0.15) which represents the upper bound of possible wait time (expressed as a percentage)
1136
+ #
1137
+ # ==== Examples
1138
+ #
1139
+ # class RemoteServiceJob < ActiveJob::Base
1140
+ # retry_on CustomAppException # defaults to ~3s wait, 5 attempts
1141
+ # retry_on AnotherCustomAppException, wait: ->(executions) { executions * 2 }
1142
+ # retry_on CustomInfrastructureException, wait: 5.minutes, attempts: :unlimited
1143
+ #
1144
+ # retry_on ActiveRecord::Deadlocked, wait: 5.seconds, attempts: 3
1145
+ # retry_on Net::OpenTimeout, Timeout::Error, wait: :polynomially_longer, attempts: 10 # retries at most 10 times for Net::OpenTimeout and Timeout::Error combined
1146
+ # # To retry at most 10 times for each individual exception:
1147
+ # # retry_on Net::OpenTimeout, wait: :polynomially_longer, attempts: 10
1148
+ # # retry_on Net::ReadTimeout, wait: 5.seconds, jitter: 0.30, attempts: 10
1149
+ # # retry_on Timeout::Error, wait: :polynomially_longer, attempts: 10
1150
+ #
1151
+ # retry_on(YetAnotherCustomAppException) do |job, error|
1152
+ # ExceptionNotifier.caught(error)
1153
+ # end
1154
+ #
1155
+ # def perform(*args)
1156
+ # # Might raise CustomAppException, AnotherCustomAppException, or YetAnotherCustomAppException for something domain specific
1157
+ # # Might raise ActiveRecord::Deadlocked when a local db deadlock is detected
1158
+ # # Might raise Net::OpenTimeout or Timeout::Error when the remote service is down
1159
+ # end
1160
+ # end
1161
+ #
1162
+ # source://activejob//lib/active_job/exceptions.rb#62
1163
+ def retry_on(*exceptions, wait: T.unsafe(nil), attempts: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), jitter: T.unsafe(nil)); end
1164
+ end
1165
+
1166
+ # source://activejob//lib/active_job/exceptions.rb#158
1167
+ ActiveJob::Exceptions::JITTER_DEFAULT = T.let(T.unsafe(nil), Object)
1168
+
1169
+ # = Active Job \Execution
1170
+ #
1171
+ # Provides methods to execute jobs immediately, and wraps job execution so
1172
+ # that exceptions configured with
1173
+ # {rescue_from}[rdoc-ref:ActiveSupport::Rescuable::ClassMethods#rescue_from]
1174
+ # are handled.
1175
+ #
1176
+ # source://activejob//lib/active_job/execution.rb#12
1177
+ module ActiveJob::Execution
1178
+ extend ::ActiveSupport::Concern
1179
+ include GeneratedInstanceMethods
1180
+ include ::ActiveSupport::Rescuable
1181
+
1182
+ mixes_in_class_methods GeneratedClassMethods
1183
+ mixes_in_class_methods ::ActiveSupport::Rescuable::ClassMethods
1184
+ mixes_in_class_methods ::ActiveJob::Execution::ClassMethods
1185
+
1186
+ # source://activejob//lib/active_job/execution.rb#60
1187
+ def perform(*_arg0); end
1188
+
1189
+ # Performs the job immediately. The job is not sent to the queuing adapter
1190
+ # but directly executed by blocking the execution of others until it's finished.
1191
+ # +perform_now+ returns the value of your job's +perform+ method.
1192
+ #
1193
+ # class MyJob < ActiveJob::Base
1194
+ # def perform
1195
+ # "Hello World!"
1196
+ # end
1197
+ # end
1198
+ #
1199
+ # puts MyJob.new(*args).perform_now # => "Hello World!"
1200
+ #
1201
+ # source://activejob//lib/active_job/execution.rb#45
1202
+ def perform_now; end
1203
+
1204
+ private
1205
+
1206
+ # source://activejob//lib/active_job/execution.rb#65
1207
+ def _perform_job; end
1208
+
1209
+ module GeneratedClassMethods
1210
+ def rescue_handlers; end
1211
+ def rescue_handlers=(value); end
1212
+ def rescue_handlers?; end
1213
+ end
1214
+
1215
+ module GeneratedInstanceMethods
1216
+ def rescue_handlers; end
1217
+ def rescue_handlers=(value); end
1218
+ def rescue_handlers?; end
1219
+ end
1220
+ end
1221
+
1222
+ # Includes methods for executing and performing jobs instantly.
1223
+ #
1224
+ # source://activejob//lib/active_job/execution.rb#17
1225
+ module ActiveJob::Execution::ClassMethods
1226
+ # source://activejob//lib/active_job/execution.rb#26
1227
+ def execute(job_data); end
1228
+
1229
+ # Performs the job immediately.
1230
+ #
1231
+ # MyJob.perform_now("mike")
1232
+ #
1233
+ # source://activejob//lib/active_job/execution.rb#22
1234
+ def perform_now(*_arg0, **_arg1, &_arg2); end
1235
+ end
1236
+
1237
+ # source://activejob//lib/active_job/instrumentation.rb#16
1238
+ module ActiveJob::Instrumentation
1239
+ extend ::ActiveSupport::Concern
1240
+
1241
+ # source://activejob//lib/active_job/instrumentation.rb#25
1242
+ def perform_now; end
1243
+
1244
+ private
1245
+
1246
+ # source://activejob//lib/active_job/instrumentation.rb#30
1247
+ def _perform_job; end
1248
+
1249
+ # source://activejob//lib/active_job/instrumentation.rb#47
1250
+ def halted_callback_hook(*_arg0); end
1251
+
1252
+ # source://activejob//lib/active_job/instrumentation.rb#35
1253
+ def instrument(operation, payload = T.unsafe(nil), &block); end
1254
+ end
1255
+
1256
+ # source://activejob//lib/active_job/log_subscriber.rb#6
1257
+ class ActiveJob::LogSubscriber < ::ActiveSupport::LogSubscriber
1258
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1259
+ def backtrace_cleaner; end
1260
+
1261
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1262
+ def backtrace_cleaner=(_arg0); end
1263
+
1264
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1265
+ def backtrace_cleaner?; end
1266
+
1267
+ # source://activejob//lib/active_job/log_subscriber.rb#130
1268
+ def discard(event); end
1269
+
1270
+ # source://activejob//lib/active_job/log_subscriber.rb#9
1271
+ def enqueue(event); end
1272
+
1273
+ # source://activejob//lib/active_job/log_subscriber.rb#49
1274
+ def enqueue_all(event); end
1275
+
1276
+ # source://activejob//lib/active_job/log_subscriber.rb#29
1277
+ def enqueue_at(event); end
1278
+
1279
+ # source://activejob//lib/active_job/log_subscriber.rb#105
1280
+ def enqueue_retry(event); end
1281
+
1282
+ # source://activejob//lib/active_job/log_subscriber.rb#86
1283
+ def perform(event); end
1284
+
1285
+ # source://activejob//lib/active_job/log_subscriber.rb#76
1286
+ def perform_start(event); end
1287
+
1288
+ # source://activejob//lib/active_job/log_subscriber.rb#120
1289
+ def retry_stopped(event); end
1290
+
1291
+ private
1292
+
1293
+ # source://activejob//lib/active_job/log_subscriber.rb#145
1294
+ def args_info(job); end
1295
+
1296
+ # source://activejob//lib/active_job/log_subscriber.rb#199
1297
+ def enqueue_source_location; end
1298
+
1299
+ # source://activejob//lib/active_job/log_subscriber.rb#207
1300
+ def enqueued_jobs_message(adapter, enqueued_jobs); end
1301
+
1302
+ # source://activejob//lib/active_job/log_subscriber.rb#183
1303
+ def error(progname = T.unsafe(nil), &block); end
1304
+
1305
+ # source://activejob//lib/active_job/log_subscriber.rb#154
1306
+ def format(arg); end
1307
+
1308
+ # source://activejob//lib/active_job/log_subscriber.rb#175
1309
+ def info(progname = T.unsafe(nil), &block); end
1310
+
1311
+ # source://activejob//lib/active_job/log_subscriber.rb#191
1312
+ def log_enqueue_source; end
1313
+
1314
+ # source://activejob//lib/active_job/log_subscriber.rb#171
1315
+ def logger; end
1316
+
1317
+ # source://activejob//lib/active_job/log_subscriber.rb#141
1318
+ def queue_name(event); end
1319
+
1320
+ # source://activejob//lib/active_job/log_subscriber.rb#167
1321
+ def scheduled_at(event); end
1322
+
1323
+ class << self
1324
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1325
+ def backtrace_cleaner; end
1326
+
1327
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1328
+ def backtrace_cleaner=(value); end
1329
+
1330
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1331
+ def backtrace_cleaner?; end
1332
+
1333
+ private
1334
+
1335
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1336
+ def __class_attr_backtrace_cleaner; end
1337
+
1338
+ # source://activejob//lib/active_job/log_subscriber.rb#7
1339
+ def __class_attr_backtrace_cleaner=(new_value); end
1340
+
1341
+ # source://activejob//lib/active_job/log_subscriber.rb#27
1342
+ def __class_attr_log_levels; end
1343
+
1344
+ # source://activejob//lib/active_job/log_subscriber.rb#27
1345
+ def __class_attr_log_levels=(new_value); end
1346
+ end
1347
+ end
1348
+
1349
+ # source://activejob//lib/active_job/logging.rb#7
1350
+ module ActiveJob::Logging
1351
+ extend ::ActiveSupport::Concern
1352
+ include GeneratedInstanceMethods
1353
+
1354
+ mixes_in_class_methods GeneratedClassMethods
1355
+
1356
+ # source://activejob//lib/active_job/logging.rb#31
1357
+ def perform_now; end
1358
+
1359
+ private
1360
+
1361
+ # @return [Boolean]
1362
+ #
1363
+ # source://activejob//lib/active_job/logging.rb#45
1364
+ def logger_tagged_by_active_job?; end
1365
+
1366
+ # source://activejob//lib/active_job/logging.rb#36
1367
+ def tag_logger(*tags, &block); end
1368
+
1369
+ module GeneratedClassMethods
1370
+ def log_arguments; end
1371
+ def log_arguments=(value); end
1372
+ def log_arguments?; end
1373
+ end
1374
+
1375
+ module GeneratedInstanceMethods; end
1376
+ end
1377
+
1378
+ # = Active Job Queue adapter
1379
+ #
1380
+ # The +ActiveJob::QueueAdapter+ module is used to load the
1381
+ # correct adapter. The default queue adapter is +:async+,
1382
+ # which loads the ActiveJob::QueueAdapters::AsyncAdapter.
1383
+ #
1384
+ # source://activejob//lib/active_job/queue_adapter.rb#20
1385
+ module ActiveJob::QueueAdapter
1386
+ extend ::ActiveSupport::Concern
1387
+ include GeneratedInstanceMethods
1388
+
1389
+ mixes_in_class_methods GeneratedClassMethods
1390
+ mixes_in_class_methods ::ActiveJob::QueueAdapter::ClassMethods
1391
+
1392
+ module GeneratedClassMethods
1393
+ def _queue_adapter; end
1394
+ def _queue_adapter=(value); end
1395
+ def _queue_adapter_name; end
1396
+ def _queue_adapter_name=(value); end
1397
+ end
1398
+
1399
+ module GeneratedInstanceMethods; end
1400
+ end
1401
+
1402
+ # Includes the setter method for changing the active queue adapter.
1403
+ #
1404
+ # source://activejob//lib/active_job/queue_adapter.rb#31
1405
+ module ActiveJob::QueueAdapter::ClassMethods
1406
+ # Returns the backend queue provider. The default queue adapter
1407
+ # is +:async+. See QueueAdapters for more information.
1408
+ #
1409
+ # source://activejob//lib/active_job/queue_adapter.rb#34
1410
+ def queue_adapter; end
1411
+
1412
+ # Specify the backend queue provider. The default queue adapter
1413
+ # is the +:async+ queue. See QueueAdapters for more
1414
+ # information.
1415
+ #
1416
+ # source://activejob//lib/active_job/queue_adapter.rb#49
1417
+ def queue_adapter=(name_or_adapter); end
1418
+
1419
+ # Returns string denoting the name of the configured queue adapter.
1420
+ # By default returns <tt>"async"</tt>.
1421
+ #
1422
+ # source://activejob//lib/active_job/queue_adapter.rb#41
1423
+ def queue_adapter_name; end
1424
+
1425
+ private
1426
+
1427
+ # source://activejob//lib/active_job/queue_adapter.rb#66
1428
+ def assign_adapter(adapter_name, queue_adapter); end
1429
+
1430
+ # @return [Boolean]
1431
+ #
1432
+ # source://activejob//lib/active_job/queue_adapter.rb#73
1433
+ def queue_adapter?(object); end
1434
+ end
1435
+
1436
+ # source://activejob//lib/active_job/queue_adapter.rb#71
1437
+ ActiveJob::QueueAdapter::ClassMethods::QUEUE_ADAPTER_METHODS = T.let(T.unsafe(nil), Array)
1438
+
1439
+ # = Active Job adapters
1440
+ #
1441
+ # Active Job has adapters for the following queuing backends:
1442
+ #
1443
+ # * {Backburner}[https://github.com/nesquena/backburner]
1444
+ # * {Delayed Job}[https://github.com/collectiveidea/delayed_job]
1445
+ # * {Que}[https://github.com/chanks/que]
1446
+ # * {queue_classic}[https://github.com/QueueClassic/queue_classic]
1447
+ # * {Resque}[https://github.com/resque/resque]
1448
+ # * {Sidekiq}[https://sidekiq.org]
1449
+ # * {Sneakers}[https://github.com/jondot/sneakers]
1450
+ # * Please Note: We are not accepting pull requests for new adapters. See the {README}[link:files/activejob/README_md.html] for more details.
1451
+ #
1452
+ # For testing and development Active Job has three built-in adapters:
1453
+ #
1454
+ # * {Active Job Async}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/AsyncAdapter.html]
1455
+ # * {Active Job Inline}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/InlineAdapter.html]
1456
+ # * {Active Job Test}[https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/TestAdapter.html]
1457
+ #
1458
+ # === Backends Features
1459
+ #
1460
+ # |-------------------|-------|--------|------------|------------|---------|---------|
1461
+ #
1462
+ # ==== Async
1463
+ #
1464
+ # Yes: The Queue Adapter has the ability to run the job in a non-blocking manner.
1465
+ # It either runs on a separate or forked process, or on a different thread.
1466
+ #
1467
+ # No: The job is run in the same process.
1468
+ #
1469
+ # ==== Queues
1470
+ #
1471
+ # Yes: Jobs may set which queue they are run in with queue_as or by using the set
1472
+ # method.
1473
+ #
1474
+ # ==== Delayed
1475
+ #
1476
+ # Yes: The adapter will run the job in the future through perform_later.
1477
+ #
1478
+ # (Gem): An additional gem is required to use perform_later with this adapter.
1479
+ #
1480
+ # No: The adapter will run jobs at the next opportunity and cannot use perform_later.
1481
+ #
1482
+ # N/A: The adapter does not support queuing.
1483
+ #
1484
+ # NOTE:
1485
+ # queue_classic supports job scheduling since version 3.1.
1486
+ # For older versions you can use the queue_classic-later gem.
1487
+ #
1488
+ # ==== Priorities
1489
+ #
1490
+ # The order in which jobs are processed can be configured differently depending
1491
+ # on the adapter.
1492
+ #
1493
+ # Job: Any class inheriting from the adapter may set the priority on the job
1494
+ # object relative to other jobs.
1495
+ #
1496
+ # Queue: The adapter can set the priority for job queues, when setting a queue
1497
+ # with Active Job this will be respected.
1498
+ #
1499
+ # Yes: Allows the priority to be set on the job object, at the queue level or
1500
+ # as default configuration option.
1501
+ #
1502
+ # No: The adapter does not allow the priority of jobs to be configured.
1503
+ #
1504
+ # N/A: The adapter does not support queuing, and therefore sorting them.
1505
+ #
1506
+ # ==== Timeout
1507
+ #
1508
+ # When a job will stop after the allotted time.
1509
+ #
1510
+ # Job: The timeout can be set for each instance of the job class.
1511
+ #
1512
+ # Queue: The timeout is set for all jobs on the queue.
1513
+ #
1514
+ # Global: The adapter is configured that all jobs have a maximum run time.
1515
+ #
1516
+ # No: The adapter does not allow the timeout of jobs to be configured.
1517
+ #
1518
+ # N/A: This adapter does not run in a separate process, and therefore timeout
1519
+ # is unsupported.
1520
+ #
1521
+ # ==== Retries
1522
+ #
1523
+ # Job: The number of retries can be set per instance of the job class.
1524
+ #
1525
+ # Yes: The Number of retries can be configured globally, for each instance or
1526
+ # on the queue. This adapter may also present failed instances of the job class
1527
+ # that can be restarted.
1528
+ #
1529
+ # Global: The adapter has a global number of retries.
1530
+ #
1531
+ # No: The adapter does not allow the number of retries to be configured.
1532
+ #
1533
+ # N/A: The adapter does not run in a separate process, and therefore doesn't
1534
+ # support retries.
1535
+ #
1536
+ # source://activejob//lib/active_job/queue_adapters.rb#112
1537
+ module ActiveJob::QueueAdapters
1538
+ extend ::ActiveSupport::Autoload
1539
+
1540
+ class << self
1541
+ # Returns adapter for specified name.
1542
+ #
1543
+ # ActiveJob::QueueAdapters.lookup(:sidekiq)
1544
+ # # => ActiveJob::QueueAdapters::SidekiqAdapter
1545
+ #
1546
+ # source://activejob//lib/active_job/queue_adapters.rb#135
1547
+ def lookup(name); end
1548
+ end
1549
+ end
1550
+
1551
+ # source://activejob//lib/active_job/queue_adapters.rb#127
1552
+ ActiveJob::QueueAdapters::ADAPTER = T.let(T.unsafe(nil), String)
1553
+
1554
+ # = Active Job Abstract Adapter
1555
+ #
1556
+ # Active Job supports multiple job queue systems. ActiveJob::QueueAdapters::AbstractAdapter
1557
+ # forms the abstraction layer which makes this possible.
1558
+ #
1559
+ # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#9
1560
+ class ActiveJob::QueueAdapters::AbstractAdapter
1561
+ # @raise [NotImplementedError]
1562
+ #
1563
+ # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#10
1564
+ def enqueue(job); end
1565
+
1566
+ # @raise [NotImplementedError]
1567
+ #
1568
+ # source://activejob//lib/active_job/queue_adapters/abstract_adapter.rb#14
1569
+ def enqueue_at(job, timestamp); end
1570
+ end
1571
+
1572
+ # = Active Job Async adapter
1573
+ #
1574
+ # The Async adapter runs jobs with an in-process thread pool.
1575
+ #
1576
+ # This is the default queue adapter. It's well-suited for dev/test since
1577
+ # it doesn't need an external infrastructure, but it's a poor fit for
1578
+ # production since it drops pending jobs on restart.
1579
+ #
1580
+ # To use this adapter, set queue adapter to +:async+:
1581
+ #
1582
+ # config.active_job.queue_adapter = :async
1583
+ #
1584
+ # To configure the adapter's thread pool, instantiate the adapter and
1585
+ # pass your own config:
1586
+ #
1587
+ # config.active_job.queue_adapter = ActiveJob::QueueAdapters::AsyncAdapter.new \
1588
+ # min_threads: 1,
1589
+ # max_threads: 2 * Concurrent.processor_count,
1590
+ # idletime: 600.seconds
1591
+ #
1592
+ # The adapter uses a {Concurrent Ruby}[https://github.com/ruby-concurrency/concurrent-ruby] thread pool to schedule and execute
1593
+ # jobs. Since jobs share a single thread pool, long-running jobs will block
1594
+ # short-lived jobs. Fine for dev/test; bad for production.
1595
+ #
1596
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#33
1597
+ class ActiveJob::QueueAdapters::AsyncAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter
1598
+ # See {Concurrent::ThreadPoolExecutor}[https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/ThreadPoolExecutor.html] for executor options.
1599
+ #
1600
+ # @return [AsyncAdapter] a new instance of AsyncAdapter
1601
+ #
1602
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#35
1603
+ def initialize(**executor_options); end
1604
+
1605
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#39
1606
+ def enqueue(job); end
1607
+
1608
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#43
1609
+ def enqueue_at(job, timestamp); end
1610
+
1611
+ # Used for our test suite.
1612
+ #
1613
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#55
1614
+ def immediate=(immediate); end
1615
+
1616
+ # Gracefully stop processing jobs. Finishes in-progress work and handles
1617
+ # any new jobs following the executor's fallback policy (`caller_runs`).
1618
+ # Waits for termination by default. Pass `wait: false` to continue.
1619
+ #
1620
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#50
1621
+ def shutdown(wait: T.unsafe(nil)); end
1622
+ end
1623
+
1624
+ # Note that we don't actually need to serialize the jobs since we're
1625
+ # performing them in-process, but we do so anyway for parity with other
1626
+ # adapters and deployment environments. Otherwise, serialization bugs
1627
+ # may creep in undetected.
1628
+ #
1629
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#63
1630
+ class ActiveJob::QueueAdapters::AsyncAdapter::JobWrapper
1631
+ # @return [JobWrapper] a new instance of JobWrapper
1632
+ #
1633
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#64
1634
+ def initialize(job); end
1635
+
1636
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#69
1637
+ def perform; end
1638
+ end
1639
+
1640
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#74
1641
+ class ActiveJob::QueueAdapters::AsyncAdapter::Scheduler
1642
+ # @return [Scheduler] a new instance of Scheduler
1643
+ #
1644
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#86
1645
+ def initialize(**options); end
1646
+
1647
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#92
1648
+ def enqueue(job, queue_name:); end
1649
+
1650
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#96
1651
+ def enqueue_at(job, timestamp, queue_name:); end
1652
+
1653
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#110
1654
+ def executor; end
1655
+
1656
+ # Returns the value of attribute immediate.
1657
+ #
1658
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#84
1659
+ def immediate; end
1660
+
1661
+ # Sets the attribute immediate
1662
+ #
1663
+ # @param value the value to set the attribute immediate to.
1664
+ #
1665
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#84
1666
+ def immediate=(_arg0); end
1667
+
1668
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#105
1669
+ def shutdown(wait: T.unsafe(nil)); end
1670
+ end
1671
+
1672
+ # source://activejob//lib/active_job/queue_adapters/async_adapter.rb#75
1673
+ ActiveJob::QueueAdapters::AsyncAdapter::Scheduler::DEFAULT_EXECUTOR_OPTIONS = T.let(T.unsafe(nil), Hash)
1674
+
1675
+ # = Active Job Inline adapter
1676
+ #
1677
+ # When enqueuing jobs with the Inline adapter the job will be executed
1678
+ # immediately.
1679
+ #
1680
+ # To use the Inline set the queue_adapter config to +:inline+.
1681
+ #
1682
+ # Rails.application.config.active_job.queue_adapter = :inline
1683
+ #
1684
+ # source://activejob//lib/active_job/queue_adapters/inline_adapter.rb#13
1685
+ class ActiveJob::QueueAdapters::InlineAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter
1686
+ # source://activejob//lib/active_job/queue_adapters/inline_adapter.rb#14
1687
+ def enqueue(job); end
1688
+
1689
+ # @raise [NotImplementedError]
1690
+ #
1691
+ # source://activejob//lib/active_job/queue_adapters/inline_adapter.rb#18
1692
+ def enqueue_at(*_arg0); end
1693
+ end
1694
+
1695
+ # = Test adapter for Active Job
1696
+ #
1697
+ # The test adapter should be used only in testing. Along with
1698
+ # ActiveJob::TestCase and ActiveJob::TestHelper
1699
+ # it makes a great tool to test your \Rails application.
1700
+ #
1701
+ # To use the test adapter set +queue_adapter+ config to +:test+.
1702
+ #
1703
+ # Rails.application.config.active_job.queue_adapter = :test
1704
+ #
1705
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#14
1706
+ class ActiveJob::QueueAdapters::TestAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter
1707
+ # Returns the value of attribute at.
1708
+ #
1709
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1710
+ def at; end
1711
+
1712
+ # Sets the attribute at
1713
+ #
1714
+ # @param value the value to set the attribute at to.
1715
+ #
1716
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1717
+ def at=(_arg0); end
1718
+
1719
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#28
1720
+ def enqueue(job); end
1721
+
1722
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#33
1723
+ def enqueue_at(job, timestamp); end
1724
+
1725
+ # Provides a store of all the enqueued jobs with the TestAdapter so you can check them.
1726
+ #
1727
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#19
1728
+ def enqueued_jobs; end
1729
+
1730
+ # Sets the attribute enqueued_jobs
1731
+ #
1732
+ # @param value the value to set the attribute enqueued_jobs to.
1733
+ #
1734
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#16
1735
+ def enqueued_jobs=(_arg0); end
1736
+
1737
+ # Returns the value of attribute filter.
1738
+ #
1739
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1740
+ def filter; end
1741
+
1742
+ # Sets the attribute filter
1743
+ #
1744
+ # @param value the value to set the attribute filter to.
1745
+ #
1746
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1747
+ def filter=(_arg0); end
1748
+
1749
+ # Returns the value of attribute perform_enqueued_at_jobs.
1750
+ #
1751
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1752
+ def perform_enqueued_at_jobs; end
1753
+
1754
+ # Sets the attribute perform_enqueued_at_jobs
1755
+ #
1756
+ # @param value the value to set the attribute perform_enqueued_at_jobs to.
1757
+ #
1758
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1759
+ def perform_enqueued_at_jobs=(_arg0); end
1760
+
1761
+ # Returns the value of attribute perform_enqueued_jobs.
1762
+ #
1763
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1764
+ def perform_enqueued_jobs; end
1765
+
1766
+ # Sets the attribute perform_enqueued_jobs
1767
+ #
1768
+ # @param value the value to set the attribute perform_enqueued_jobs to.
1769
+ #
1770
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1771
+ def perform_enqueued_jobs=(_arg0); end
1772
+
1773
+ # Provides a store of all the performed jobs with the TestAdapter so you can check them.
1774
+ #
1775
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#24
1776
+ def performed_jobs; end
1777
+
1778
+ # Sets the attribute performed_jobs
1779
+ #
1780
+ # @param value the value to set the attribute performed_jobs to.
1781
+ #
1782
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#16
1783
+ def performed_jobs=(_arg0); end
1784
+
1785
+ # Returns the value of attribute queue.
1786
+ #
1787
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1788
+ def queue; end
1789
+
1790
+ # Sets the attribute queue
1791
+ #
1792
+ # @param value the value to set the attribute queue to.
1793
+ #
1794
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1795
+ def queue=(_arg0); end
1796
+
1797
+ # Returns the value of attribute reject.
1798
+ #
1799
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1800
+ def reject; end
1801
+
1802
+ # Sets the attribute reject
1803
+ #
1804
+ # @param value the value to set the attribute reject to.
1805
+ #
1806
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#15
1807
+ def reject=(_arg0); end
1808
+
1809
+ private
1810
+
1811
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#79
1812
+ def filter_as_proc(filter); end
1813
+
1814
+ # @return [Boolean]
1815
+ #
1816
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#57
1817
+ def filtered?(job); end
1818
+
1819
+ # @return [Boolean]
1820
+ #
1821
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#71
1822
+ def filtered_job_class?(job); end
1823
+
1824
+ # @return [Boolean]
1825
+ #
1826
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#65
1827
+ def filtered_queue?(job); end
1828
+
1829
+ # @return [Boolean]
1830
+ #
1831
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#61
1832
+ def filtered_time?(job); end
1833
+
1834
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#39
1835
+ def job_to_hash(job, extras = T.unsafe(nil)); end
1836
+
1837
+ # source://activejob//lib/active_job/queue_adapters/test_adapter.rb#48
1838
+ def perform_or_enqueue(perform, job, job_data); end
1839
+ end
1840
+
1841
+ # source://activejob//lib/active_job/queue_name.rb#4
1842
+ module ActiveJob::QueueName
1843
+ extend ::ActiveSupport::Concern
1844
+ include GeneratedInstanceMethods
1845
+
1846
+ mixes_in_class_methods GeneratedClassMethods
1847
+ mixes_in_class_methods ::ActiveJob::QueueName::ClassMethods
1848
+
1849
+ # Returns the name of the queue the job will be run on.
1850
+ #
1851
+ # source://activejob//lib/active_job/queue_name.rb#61
1852
+ def queue_name; end
1853
+
1854
+ module GeneratedClassMethods
1855
+ def queue_name; end
1856
+ def queue_name=(value); end
1857
+ def queue_name?; end
1858
+ def queue_name_delimiter; end
1859
+ def queue_name_delimiter=(value); end
1860
+ def queue_name_delimiter?; end
1861
+ def queue_name_prefix; end
1862
+ def queue_name_prefix=(value); end
1863
+ def queue_name_prefix?; end
1864
+ end
1865
+
1866
+ module GeneratedInstanceMethods
1867
+ def queue_name_prefix; end
1868
+ def queue_name_prefix=(value); end
1869
+ def queue_name_prefix?; end
1870
+ end
1871
+ end
1872
+
1873
+ # Includes the ability to override the default queue name and prefix.
1874
+ #
1875
+ # source://activejob//lib/active_job/queue_name.rb#8
1876
+ module ActiveJob::QueueName::ClassMethods
1877
+ # source://activejob//lib/active_job/queue_name.rb#9
1878
+ def default_queue_name; end
1879
+
1880
+ # source://activejob//lib/active_job/queue_name.rb#9
1881
+ def default_queue_name=(val); end
1882
+
1883
+ # Specifies the name of the queue to process the job on.
1884
+ #
1885
+ # class PublishToFeedJob < ActiveJob::Base
1886
+ # queue_as :feeds
1887
+ #
1888
+ # def perform(post)
1889
+ # post.to_feed!
1890
+ # end
1891
+ # end
1892
+ #
1893
+ # Can be given a block that will evaluate in the context of the job
1894
+ # so that a dynamic queue name can be applied:
1895
+ #
1896
+ # class PublishToFeedJob < ApplicationJob
1897
+ # queue_as do
1898
+ # post = self.arguments.first
1899
+ #
1900
+ # if post.paid?
1901
+ # :paid_feeds
1902
+ # else
1903
+ # :feeds
1904
+ # end
1905
+ # end
1906
+ #
1907
+ # def perform(post)
1908
+ # post.to_feed!
1909
+ # end
1910
+ # end
1911
+ #
1912
+ # source://activejob//lib/active_job/queue_name.rb#39
1913
+ def queue_as(part_name = T.unsafe(nil), &block); end
1914
+
1915
+ # source://activejob//lib/active_job/queue_name.rb#47
1916
+ def queue_name_from_part(part_name); end
1917
+
1918
+ class << self
1919
+ # source://activejob//lib/active_job/queue_name.rb#9
1920
+ def default_queue_name; end
1921
+
1922
+ # source://activejob//lib/active_job/queue_name.rb#9
1923
+ def default_queue_name=(val); end
1924
+ end
1925
+ end
1926
+
1927
+ # source://activejob//lib/active_job/queue_priority.rb#4
1928
+ module ActiveJob::QueuePriority
1929
+ extend ::ActiveSupport::Concern
1930
+ include GeneratedInstanceMethods
1931
+
1932
+ mixes_in_class_methods GeneratedClassMethods
1933
+ mixes_in_class_methods ::ActiveJob::QueuePriority::ClassMethods
1934
+
1935
+ # Returns the priority that the job will be created with
1936
+ #
1937
+ # source://activejob//lib/active_job/queue_priority.rb#53
1938
+ def priority; end
1939
+
1940
+ module GeneratedClassMethods
1941
+ def priority; end
1942
+ def priority=(value); end
1943
+ def priority?; end
1944
+ end
1945
+
1946
+ module GeneratedInstanceMethods; end
1947
+ end
1948
+
1949
+ # Includes the ability to override the default queue priority.
1950
+ #
1951
+ # source://activejob//lib/active_job/queue_priority.rb#8
1952
+ module ActiveJob::QueuePriority::ClassMethods
1953
+ # source://activejob//lib/active_job/queue_priority.rb#9
1954
+ def default_priority; end
1955
+
1956
+ # source://activejob//lib/active_job/queue_priority.rb#9
1957
+ def default_priority=(val); end
1958
+
1959
+ # Specifies the priority of the queue to create the job with.
1960
+ #
1961
+ # class PublishToFeedJob < ActiveJob::Base
1962
+ # queue_with_priority 50
1963
+ #
1964
+ # def perform(post)
1965
+ # post.to_feed!
1966
+ # end
1967
+ # end
1968
+ #
1969
+ # Can be given a block that will evaluate in the context of the job
1970
+ # so that a dynamic priority can be applied:
1971
+ #
1972
+ # class PublishToFeedJob < ApplicationJob
1973
+ # queue_with_priority do
1974
+ # post = self.arguments.first
1975
+ #
1976
+ # if post.paid?
1977
+ # 10
1978
+ # else
1979
+ # 50
1980
+ # end
1981
+ # end
1982
+ #
1983
+ # def perform(post)
1984
+ # post.to_feed!
1985
+ # end
1986
+ # end
1987
+ #
1988
+ # source://activejob//lib/active_job/queue_priority.rb#39
1989
+ def queue_with_priority(priority = T.unsafe(nil), &block); end
1990
+
1991
+ class << self
1992
+ # source://activejob//lib/active_job/queue_priority.rb#9
1993
+ def default_priority; end
1994
+
1995
+ # source://activejob//lib/active_job/queue_priority.rb#9
1996
+ def default_priority=(val); end
1997
+ end
1998
+ end
1999
+
2000
+ # = Active Job Railtie
2001
+ #
2002
+ # source://activejob//lib/active_job/railtie.rb#8
2003
+ class ActiveJob::Railtie < ::Rails::Railtie; end
2004
+
2005
+ # Raised when an unsupported argument type is set as a job argument. We
2006
+ # currently support String, Integer, Float, NilClass, TrueClass, FalseClass,
2007
+ # BigDecimal, Symbol, Date, Time, DateTime, ActiveSupport::TimeWithZone,
2008
+ # ActiveSupport::Duration, Hash, ActiveSupport::HashWithIndifferentAccess,
2009
+ # Array, Range, or GlobalID::Identification instances, although this can be
2010
+ # extended by adding custom serializers.
2011
+ # Raised if you set the key for a Hash something else than a string or
2012
+ # a symbol. Also raised when trying to serialize an object which can't be
2013
+ # identified with a GlobalID - such as an unpersisted Active Record model.
2014
+ #
2015
+ # source://activejob//lib/active_job/arguments.rb#26
2016
+ class ActiveJob::SerializationError < ::ArgumentError; end
2017
+
2018
+ # = Active Job \Serializers
2019
+ #
2020
+ # The +ActiveJob::Serializers+ module is used to store a list of known serializers
2021
+ # and to add new ones. It also has helpers to serialize/deserialize objects.
2022
+ #
2023
+ # source://activejob//lib/active_job/serializers.rb#8
2024
+ module ActiveJob::Serializers
2025
+ extend ::ActiveSupport::Autoload
2026
+
2027
+ # source://activejob//lib/active_job/serializers.rb#23
2028
+ def _additional_serializers; end
2029
+
2030
+ # source://activejob//lib/active_job/serializers.rb#23
2031
+ def _additional_serializers=(val); end
2032
+
2033
+ class << self
2034
+ # source://activejob//lib/active_job/serializers.rb#23
2035
+ def _additional_serializers; end
2036
+
2037
+ # source://activejob//lib/active_job/serializers.rb#23
2038
+ def _additional_serializers=(val); end
2039
+
2040
+ # Adds new serializers to a list of known serializers.
2041
+ #
2042
+ # source://activejob//lib/active_job/serializers.rb#55
2043
+ def add_serializers(*new_serializers); end
2044
+
2045
+ # Returns deserialized object.
2046
+ # Will look up through all known serializers.
2047
+ # If no serializer found will raise <tt>ArgumentError</tt>.
2048
+ #
2049
+ # @raise [ArgumentError]
2050
+ #
2051
+ # source://activejob//lib/active_job/serializers.rb#39
2052
+ def deserialize(argument); end
2053
+
2054
+ # Returns serialized representative of the passed object.
2055
+ # Will look up through all known serializers.
2056
+ # Raises ActiveJob::SerializationError if it can't find a proper serializer.
2057
+ #
2058
+ # @raise [SerializationError]
2059
+ #
2060
+ # source://activejob//lib/active_job/serializers.rb#30
2061
+ def serialize(argument); end
2062
+
2063
+ # Returns list of known serializers.
2064
+ #
2065
+ # source://activejob//lib/active_job/serializers.rb#50
2066
+ def serializers; end
2067
+ end
2068
+ end
2069
+
2070
+ # source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#7
2071
+ class ActiveJob::Serializers::BigDecimalSerializer < ::ActiveJob::Serializers::ObjectSerializer
2072
+ # source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#12
2073
+ def deserialize(hash); end
2074
+
2075
+ # source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#8
2076
+ def serialize(big_decimal); end
2077
+
2078
+ private
2079
+
2080
+ # source://activejob//lib/active_job/serializers/big_decimal_serializer.rb#17
2081
+ def klass; end
2082
+ end
2083
+
2084
+ # source://activejob//lib/active_job/serializers/date_serializer.rb#5
2085
+ class ActiveJob::Serializers::DateSerializer < ::ActiveJob::Serializers::ObjectSerializer
2086
+ # source://activejob//lib/active_job/serializers/date_serializer.rb#10
2087
+ def deserialize(hash); end
2088
+
2089
+ # source://activejob//lib/active_job/serializers/date_serializer.rb#6
2090
+ def serialize(date); end
2091
+
2092
+ private
2093
+
2094
+ # source://activejob//lib/active_job/serializers/date_serializer.rb#15
2095
+ def klass; end
2096
+ end
2097
+
2098
+ # source://activejob//lib/active_job/serializers/date_time_serializer.rb#5
2099
+ class ActiveJob::Serializers::DateTimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer
2100
+ # source://activejob//lib/active_job/serializers/date_time_serializer.rb#6
2101
+ def deserialize(hash); end
2102
+
2103
+ private
2104
+
2105
+ # source://activejob//lib/active_job/serializers/date_time_serializer.rb#11
2106
+ def klass; end
2107
+ end
2108
+
2109
+ # source://activejob//lib/active_job/serializers/duration_serializer.rb#5
2110
+ class ActiveJob::Serializers::DurationSerializer < ::ActiveJob::Serializers::ObjectSerializer
2111
+ # source://activejob//lib/active_job/serializers/duration_serializer.rb#12
2112
+ def deserialize(hash); end
2113
+
2114
+ # source://activejob//lib/active_job/serializers/duration_serializer.rb#6
2115
+ def serialize(duration); end
2116
+
2117
+ private
2118
+
2119
+ # source://activejob//lib/active_job/serializers/duration_serializer.rb#20
2120
+ def klass; end
2121
+ end
2122
+
2123
+ # source://activejob//lib/active_job/serializers/module_serializer.rb#5
2124
+ class ActiveJob::Serializers::ModuleSerializer < ::ActiveJob::Serializers::ObjectSerializer
2125
+ # source://activejob//lib/active_job/serializers/module_serializer.rb#11
2126
+ def deserialize(hash); end
2127
+
2128
+ # @raise [SerializationError]
2129
+ #
2130
+ # source://activejob//lib/active_job/serializers/module_serializer.rb#6
2131
+ def serialize(constant); end
2132
+
2133
+ private
2134
+
2135
+ # source://activejob//lib/active_job/serializers/module_serializer.rb#16
2136
+ def klass; end
2137
+ end
2138
+
2139
+ # Base class for serializing and deserializing custom objects.
2140
+ #
2141
+ # Example:
2142
+ #
2143
+ # class MoneySerializer < ActiveJob::Serializers::ObjectSerializer
2144
+ # def serialize(money)
2145
+ # super("amount" => money.amount, "currency" => money.currency)
2146
+ # end
2147
+ #
2148
+ # def deserialize(hash)
2149
+ # Money.new(hash["amount"], hash["currency"])
2150
+ # end
2151
+ #
2152
+ # private
2153
+ #
2154
+ # def klass
2155
+ # Money
2156
+ # end
2157
+ # end
2158
+ #
2159
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#26
2160
+ class ActiveJob::Serializers::ObjectSerializer
2161
+ include ::Singleton::SingletonInstanceMethods
2162
+ include ::Singleton
2163
+ extend ::Singleton::SingletonClassMethods
2164
+
2165
+ # Deserializes an argument from a JSON primitive type.
2166
+ #
2167
+ # @raise [NotImplementedError]
2168
+ #
2169
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#44
2170
+ def deserialize(json); end
2171
+
2172
+ # Serializes an argument to a JSON primitive type.
2173
+ #
2174
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#39
2175
+ def serialize(hash); end
2176
+
2177
+ # Determines if an argument should be serialized by a serializer.
2178
+ #
2179
+ # @return [Boolean]
2180
+ #
2181
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#34
2182
+ def serialize?(argument); end
2183
+
2184
+ private
2185
+
2186
+ # The class of the object that will be serialized.
2187
+ #
2188
+ # @raise [NotImplementedError]
2189
+ #
2190
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#50
2191
+ def klass; end
2192
+
2193
+ class << self
2194
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#30
2195
+ def deserialize(*_arg0, **_arg1, &_arg2); end
2196
+
2197
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#30
2198
+ def serialize(*_arg0, **_arg1, &_arg2); end
2199
+
2200
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#30
2201
+ def serialize?(*_arg0, **_arg1, &_arg2); end
2202
+
2203
+ private
2204
+
2205
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#27
2206
+ def allocate; end
2207
+
2208
+ # source://activejob//lib/active_job/serializers/object_serializer.rb#27
2209
+ def new(*_arg0); end
2210
+ end
2211
+ end
2212
+
2213
+ # source://activejob//lib/active_job/serializers/range_serializer.rb#5
2214
+ class ActiveJob::Serializers::RangeSerializer < ::ActiveJob::Serializers::ObjectSerializer
2215
+ # source://activejob//lib/active_job/serializers/range_serializer.rb#13
2216
+ def deserialize(hash); end
2217
+
2218
+ # source://activejob//lib/active_job/serializers/range_serializer.rb#8
2219
+ def serialize(range); end
2220
+
2221
+ private
2222
+
2223
+ # source://activejob//lib/active_job/serializers/range_serializer.rb#18
2224
+ def klass; end
2225
+ end
2226
+
2227
+ # source://activejob//lib/active_job/serializers/range_serializer.rb#6
2228
+ ActiveJob::Serializers::RangeSerializer::KEYS = T.let(T.unsafe(nil), Array)
2229
+
2230
+ # source://activejob//lib/active_job/serializers/symbol_serializer.rb#5
2231
+ class ActiveJob::Serializers::SymbolSerializer < ::ActiveJob::Serializers::ObjectSerializer
2232
+ # source://activejob//lib/active_job/serializers/symbol_serializer.rb#10
2233
+ def deserialize(argument); end
2234
+
2235
+ # source://activejob//lib/active_job/serializers/symbol_serializer.rb#6
2236
+ def serialize(argument); end
2237
+
2238
+ private
2239
+
2240
+ # source://activejob//lib/active_job/serializers/symbol_serializer.rb#15
2241
+ def klass; end
2242
+ end
2243
+
2244
+ # source://activejob//lib/active_job/serializers/time_object_serializer.rb#5
2245
+ class ActiveJob::Serializers::TimeObjectSerializer < ::ActiveJob::Serializers::ObjectSerializer
2246
+ # source://activejob//lib/active_job/serializers/time_object_serializer.rb#8
2247
+ def serialize(time); end
2248
+ end
2249
+
2250
+ # source://activejob//lib/active_job/serializers/time_object_serializer.rb#6
2251
+ ActiveJob::Serializers::TimeObjectSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer)
2252
+
2253
+ # source://activejob//lib/active_job/serializers/time_serializer.rb#5
2254
+ class ActiveJob::Serializers::TimeSerializer < ::ActiveJob::Serializers::TimeObjectSerializer
2255
+ # source://activejob//lib/active_job/serializers/time_serializer.rb#6
2256
+ def deserialize(hash); end
2257
+
2258
+ private
2259
+
2260
+ # source://activejob//lib/active_job/serializers/time_serializer.rb#11
2261
+ def klass; end
2262
+ end
2263
+
2264
+ # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#5
2265
+ class ActiveJob::Serializers::TimeWithZoneSerializer < ::ActiveJob::Serializers::ObjectSerializer
2266
+ # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#15
2267
+ def deserialize(hash); end
2268
+
2269
+ # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#8
2270
+ def serialize(time_with_zone); end
2271
+
2272
+ private
2273
+
2274
+ # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#20
2275
+ def klass; end
2276
+ end
2277
+
2278
+ # source://activejob//lib/active_job/serializers/time_with_zone_serializer.rb#6
2279
+ ActiveJob::Serializers::TimeWithZoneSerializer::NANO_PRECISION = T.let(T.unsafe(nil), Integer)
2280
+
2281
+ # source://activejob//lib/active_job/test_case.rb#6
2282
+ class ActiveJob::TestCase < ::ActiveSupport::TestCase
2283
+ include ::ActiveJob::TestHelper
2284
+ end
2285
+
2286
+ # Provides helper methods for testing Active Job
2287
+ #
2288
+ # source://activejob//lib/active_job/test_helper.rb#8
2289
+ module ActiveJob::TestHelper
2290
+ include ::ActiveSupport::Testing::Assertions
2291
+
2292
+ # source://activejob//lib/active_job/test_helper.rb#56
2293
+ def after_teardown; end
2294
+
2295
+ # Asserts that the number of enqueued jobs matches the given number.
2296
+ #
2297
+ # def test_jobs
2298
+ # assert_enqueued_jobs 0
2299
+ # HelloJob.perform_later('david')
2300
+ # assert_enqueued_jobs 1
2301
+ # HelloJob.perform_later('abdelkader')
2302
+ # assert_enqueued_jobs 2
2303
+ # end
2304
+ #
2305
+ # If a block is passed, asserts that the block will cause the specified number of
2306
+ # jobs to be enqueued.
2307
+ #
2308
+ # def test_jobs_again
2309
+ # assert_enqueued_jobs 1 do
2310
+ # HelloJob.perform_later('cristian')
2311
+ # end
2312
+ #
2313
+ # assert_enqueued_jobs 2 do
2314
+ # HelloJob.perform_later('aaron')
2315
+ # HelloJob.perform_later('rafael')
2316
+ # end
2317
+ # end
2318
+ #
2319
+ # Asserts the number of times a specific job was enqueued by passing +:only+ option.
2320
+ #
2321
+ # def test_logging_job
2322
+ # assert_enqueued_jobs 1, only: LoggingJob do
2323
+ # LoggingJob.perform_later
2324
+ # HelloJob.perform_later('jeremy')
2325
+ # end
2326
+ # end
2327
+ #
2328
+ # Asserts the number of times a job except specific class was enqueued by passing +:except+ option.
2329
+ #
2330
+ # def test_logging_job
2331
+ # assert_enqueued_jobs 1, except: HelloJob do
2332
+ # LoggingJob.perform_later
2333
+ # HelloJob.perform_later('jeremy')
2334
+ # end
2335
+ # end
2336
+ #
2337
+ # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
2338
+ # a hash containing the job's class and it's argument are passed as argument.
2339
+ #
2340
+ # Asserts the number of times a job is enqueued to a specific queue by passing +:queue+ option.
2341
+ #
2342
+ # def test_logging_job
2343
+ # assert_enqueued_jobs 2, queue: 'default' do
2344
+ # LoggingJob.perform_later
2345
+ # HelloJob.perform_later('elfassy')
2346
+ # end
2347
+ # end
2348
+ #
2349
+ # source://activejob//lib/active_job/test_helper.rb#122
2350
+ def assert_enqueued_jobs(number, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end
2351
+
2352
+ # Asserts that the job has been enqueued with the given arguments.
2353
+ #
2354
+ # def test_assert_enqueued_with
2355
+ # MyJob.perform_later(1,2,3)
2356
+ # assert_enqueued_with(job: MyJob, args: [1,2,3])
2357
+ #
2358
+ # MyJob.set(wait_until: Date.tomorrow.noon, queue: "my_queue").perform_later
2359
+ # assert_enqueued_with(at: Date.tomorrow.noon, queue: "my_queue")
2360
+ # end
2361
+ #
2362
+ # For keyword arguments, specify them as a hash inside an array:
2363
+ #
2364
+ # def test_assert_enqueued_with_keyword_arguments
2365
+ # MyJob.perform_later(arg1: 'value1', arg2: 'value2')
2366
+ # assert_enqueued_with(job: MyJob, args: [{ arg1: 'value1', arg2: 'value2' }])
2367
+ # end
2368
+ #
2369
+ # The given arguments may also be specified as matcher procs that return a
2370
+ # boolean value indicating whether a job's attribute meets certain criteria.
2371
+ #
2372
+ # For example, a proc can be used to match a range of times:
2373
+ #
2374
+ # def test_assert_enqueued_with
2375
+ # at_matcher = ->(job_at) { (Date.yesterday..Date.tomorrow).cover?(job_at) }
2376
+ #
2377
+ # MyJob.set(wait_until: Date.today.noon).perform_later
2378
+ #
2379
+ # assert_enqueued_with(job: MyJob, at: at_matcher)
2380
+ # end
2381
+ #
2382
+ # A proc can also be used to match a subset of a job's args:
2383
+ #
2384
+ # def test_assert_enqueued_with
2385
+ # args_matcher = ->(job_args) { job_args[0].key?(:foo) }
2386
+ #
2387
+ # MyJob.perform_later(foo: "bar", other_arg: "No need to check in the test")
2388
+ #
2389
+ # assert_enqueued_with(job: MyJob, args: args_matcher)
2390
+ # end
2391
+ #
2392
+ # If a block is passed, asserts that the block will cause the job to be
2393
+ # enqueued with the given arguments.
2394
+ #
2395
+ # def test_assert_enqueued_with
2396
+ # assert_enqueued_with(job: MyJob, args: [1,2,3]) do
2397
+ # MyJob.perform_later(1,2,3)
2398
+ # end
2399
+ #
2400
+ # assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon) do
2401
+ # MyJob.set(wait_until: Date.tomorrow.noon).perform_later
2402
+ # end
2403
+ # end
2404
+ #
2405
+ # source://activejob//lib/active_job/test_helper.rb#406
2406
+ def assert_enqueued_with(job: T.unsafe(nil), args: T.unsafe(nil), at: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), &block); end
2407
+
2408
+ # Asserts that no jobs have been enqueued.
2409
+ #
2410
+ # def test_jobs
2411
+ # assert_no_enqueued_jobs
2412
+ # HelloJob.perform_later('jeremy')
2413
+ # assert_enqueued_jobs 1
2414
+ # end
2415
+ #
2416
+ # If a block is passed, asserts that the block will not cause any job to be enqueued.
2417
+ #
2418
+ # def test_jobs_again
2419
+ # assert_no_enqueued_jobs do
2420
+ # # No job should be enqueued from this block
2421
+ # end
2422
+ # end
2423
+ #
2424
+ # Asserts that no jobs of a specific kind are enqueued by passing +:only+ option.
2425
+ #
2426
+ # def test_no_logging
2427
+ # assert_no_enqueued_jobs only: LoggingJob do
2428
+ # HelloJob.perform_later('jeremy')
2429
+ # end
2430
+ # end
2431
+ #
2432
+ # Asserts that no jobs except specific class are enqueued by passing +:except+ option.
2433
+ #
2434
+ # def test_no_logging
2435
+ # assert_no_enqueued_jobs except: HelloJob do
2436
+ # HelloJob.perform_later('jeremy')
2437
+ # end
2438
+ # end
2439
+ #
2440
+ # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
2441
+ # a hash containing the job's class and it's argument are passed as argument.
2442
+ #
2443
+ # Asserts that no jobs are enqueued to a specific queue by passing +:queue+ option
2444
+ #
2445
+ # def test_no_logging
2446
+ # assert_no_enqueued_jobs queue: 'default' do
2447
+ # LoggingJob.set(queue: :some_queue).perform_later
2448
+ # end
2449
+ # end
2450
+ #
2451
+ # Note: This assertion is simply a shortcut for:
2452
+ #
2453
+ # assert_enqueued_jobs 0, &block
2454
+ #
2455
+ # source://activejob//lib/active_job/test_helper.rb#186
2456
+ def assert_no_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end
2457
+
2458
+ # Asserts that no jobs have been performed.
2459
+ #
2460
+ # def test_jobs
2461
+ # assert_no_performed_jobs
2462
+ #
2463
+ # perform_enqueued_jobs do
2464
+ # HelloJob.perform_later('matthew')
2465
+ # assert_performed_jobs 1
2466
+ # end
2467
+ # end
2468
+ #
2469
+ # If a block is passed, asserts that the block will not cause any job to be performed.
2470
+ #
2471
+ # def test_jobs_again
2472
+ # assert_no_performed_jobs do
2473
+ # # No job should be performed from this block
2474
+ # end
2475
+ # end
2476
+ #
2477
+ # The block form supports filtering. If the +:only+ option is specified,
2478
+ # then only the listed job(s) will not be performed.
2479
+ #
2480
+ # def test_no_logging
2481
+ # assert_no_performed_jobs only: LoggingJob do
2482
+ # HelloJob.perform_later('jeremy')
2483
+ # end
2484
+ # end
2485
+ #
2486
+ # Also if the +:except+ option is specified,
2487
+ # then the job(s) except specific class will not be performed.
2488
+ #
2489
+ # def test_no_logging
2490
+ # assert_no_performed_jobs except: HelloJob do
2491
+ # HelloJob.perform_later('jeremy')
2492
+ # end
2493
+ # end
2494
+ #
2495
+ # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
2496
+ # an instance of the job will be passed as argument.
2497
+ #
2498
+ # If the +:queue+ option is specified,
2499
+ # then only the job(s) enqueued to a specific queue will not be performed.
2500
+ #
2501
+ # def test_assert_no_performed_jobs_with_queue_option
2502
+ # assert_no_performed_jobs queue: :some_queue do
2503
+ # HelloJob.set(queue: :other_queue).perform_later("jeremy")
2504
+ # end
2505
+ # end
2506
+ #
2507
+ # Note: This assertion is simply a shortcut for:
2508
+ #
2509
+ # assert_performed_jobs 0, &block
2510
+ #
2511
+ # source://activejob//lib/active_job/test_helper.rb#348
2512
+ def assert_no_performed_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end
2513
+
2514
+ # Asserts that the number of performed jobs matches the given number.
2515
+ # If no block is passed, <tt>perform_enqueued_jobs</tt>
2516
+ # must be called around or after the job call.
2517
+ #
2518
+ # def test_jobs
2519
+ # assert_performed_jobs 0
2520
+ #
2521
+ # perform_enqueued_jobs do
2522
+ # HelloJob.perform_later('xavier')
2523
+ # end
2524
+ # assert_performed_jobs 1
2525
+ #
2526
+ # HelloJob.perform_later('yves')
2527
+ #
2528
+ # perform_enqueued_jobs
2529
+ #
2530
+ # assert_performed_jobs 2
2531
+ # end
2532
+ #
2533
+ # If a block is passed, asserts that the block will cause the specified number of
2534
+ # jobs to be performed.
2535
+ #
2536
+ # def test_jobs_again
2537
+ # assert_performed_jobs 1 do
2538
+ # HelloJob.perform_later('robin')
2539
+ # end
2540
+ #
2541
+ # assert_performed_jobs 2 do
2542
+ # HelloJob.perform_later('carlos')
2543
+ # HelloJob.perform_later('sean')
2544
+ # end
2545
+ # end
2546
+ #
2547
+ # This method also supports filtering. If the +:only+ option is specified,
2548
+ # then only the listed job(s) will be performed.
2549
+ #
2550
+ # def test_hello_job
2551
+ # assert_performed_jobs 1, only: HelloJob do
2552
+ # HelloJob.perform_later('jeremy')
2553
+ # LoggingJob.perform_later
2554
+ # end
2555
+ # end
2556
+ #
2557
+ # Also if the +:except+ option is specified,
2558
+ # then the job(s) except specific class will be performed.
2559
+ #
2560
+ # def test_hello_job
2561
+ # assert_performed_jobs 1, except: LoggingJob do
2562
+ # HelloJob.perform_later('jeremy')
2563
+ # LoggingJob.perform_later
2564
+ # end
2565
+ # end
2566
+ #
2567
+ # An array may also be specified, to support testing multiple jobs.
2568
+ #
2569
+ # def test_hello_and_logging_jobs
2570
+ # assert_nothing_raised do
2571
+ # assert_performed_jobs 2, only: [HelloJob, LoggingJob] do
2572
+ # HelloJob.perform_later('jeremy')
2573
+ # LoggingJob.perform_later('stewie')
2574
+ # RescueJob.perform_later('david')
2575
+ # end
2576
+ # end
2577
+ # end
2578
+ #
2579
+ # A proc may also be specified. When passed a Proc, the job's instance will be passed as argument.
2580
+ #
2581
+ # def test_hello_and_logging_jobs
2582
+ # assert_nothing_raised do
2583
+ # assert_performed_jobs(1, only: ->(job) { job.is_a?(HelloJob) }) do
2584
+ # HelloJob.perform_later('jeremy')
2585
+ # LoggingJob.perform_later('stewie')
2586
+ # RescueJob.perform_later('david')
2587
+ # end
2588
+ # end
2589
+ # end
2590
+ #
2591
+ # If the +:queue+ option is specified,
2592
+ # then only the job(s) enqueued to a specific queue will be performed.
2593
+ #
2594
+ # def test_assert_performed_jobs_with_queue_option
2595
+ # assert_performed_jobs 1, queue: :some_queue do
2596
+ # HelloJob.set(queue: :some_queue).perform_later("jeremy")
2597
+ # HelloJob.set(queue: :other_queue).perform_later("bogdan")
2598
+ # end
2599
+ # end
2600
+ #
2601
+ # source://activejob//lib/active_job/test_helper.rb#278
2602
+ def assert_performed_jobs(number, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end
2603
+
2604
+ # Asserts that the job has been performed with the given arguments.
2605
+ #
2606
+ # def test_assert_performed_with
2607
+ # MyJob.perform_later(1,2,3)
2608
+ #
2609
+ # perform_enqueued_jobs
2610
+ #
2611
+ # assert_performed_with(job: MyJob, args: [1,2,3])
2612
+ #
2613
+ # MyJob.set(wait_until: Date.tomorrow.noon, queue: "my_queue").perform_later
2614
+ #
2615
+ # perform_enqueued_jobs
2616
+ #
2617
+ # assert_performed_with(at: Date.tomorrow.noon, queue: "my_queue")
2618
+ # end
2619
+ #
2620
+ # The given arguments may also be specified as matcher procs that return a
2621
+ # boolean value indicating whether a job's attribute meets certain criteria.
2622
+ #
2623
+ # For example, a proc can be used to match a range of times:
2624
+ #
2625
+ # def test_assert_performed_with
2626
+ # at_matcher = ->(job_at) { (Date.yesterday..Date.tomorrow).cover?(job_at) }
2627
+ #
2628
+ # MyJob.set(wait_until: Date.today.noon).perform_later
2629
+ #
2630
+ # perform_enqueued_jobs
2631
+ #
2632
+ # assert_performed_with(job: MyJob, at: at_matcher)
2633
+ # end
2634
+ #
2635
+ # A proc can also be used to match a subset of a job's args:
2636
+ #
2637
+ # def test_assert_performed_with
2638
+ # args_matcher = ->(job_args) { job_args[0].key?(:foo) }
2639
+ #
2640
+ # MyJob.perform_later(foo: "bar", other_arg: "No need to check in the test")
2641
+ #
2642
+ # perform_enqueued_jobs
2643
+ #
2644
+ # assert_performed_with(job: MyJob, args: args_matcher)
2645
+ # end
2646
+ #
2647
+ # If a block is passed, that block performs all of the jobs that were
2648
+ # enqueued throughout the duration of the block and asserts that
2649
+ # the job has been performed with the given arguments in the block.
2650
+ #
2651
+ # def test_assert_performed_with
2652
+ # assert_performed_with(job: MyJob, args: [1,2,3]) do
2653
+ # MyJob.perform_later(1,2,3)
2654
+ # end
2655
+ #
2656
+ # assert_performed_with(job: MyJob, at: Date.tomorrow.noon) do
2657
+ # MyJob.set(wait_until: Date.tomorrow.noon).perform_later
2658
+ # end
2659
+ # end
2660
+ #
2661
+ # source://activejob//lib/active_job/test_helper.rb#510
2662
+ def assert_performed_with(job: T.unsafe(nil), args: T.unsafe(nil), at: T.unsafe(nil), queue: T.unsafe(nil), priority: T.unsafe(nil), &block); end
2663
+
2664
+ # source://activejob//lib/active_job/test_helper.rb#41
2665
+ def before_setup; end
2666
+
2667
+ # source://activejob//lib/active_job/test_helper.rb#9
2668
+ def enqueued_jobs(*_arg0, **_arg1, &_arg2); end
2669
+
2670
+ # source://activejob//lib/active_job/test_helper.rb#9
2671
+ def enqueued_jobs=(arg); end
2672
+
2673
+ # Performs all enqueued jobs. If a block is given, performs all of the jobs
2674
+ # that were enqueued throughout the duration of the block. If a block is
2675
+ # not given, performs all of the enqueued jobs up to this point in the test.
2676
+ #
2677
+ # def test_perform_enqueued_jobs
2678
+ # perform_enqueued_jobs do
2679
+ # MyJob.perform_later(1, 2, 3)
2680
+ # end
2681
+ # assert_performed_jobs 1
2682
+ # end
2683
+ #
2684
+ # def test_perform_enqueued_jobs_without_block
2685
+ # MyJob.perform_later(1, 2, 3)
2686
+ #
2687
+ # perform_enqueued_jobs
2688
+ #
2689
+ # assert_performed_jobs 1
2690
+ # end
2691
+ #
2692
+ # This method also supports filtering. If the +:only+ option is specified,
2693
+ # then only the listed job(s) will be performed.
2694
+ #
2695
+ # def test_perform_enqueued_jobs_with_only
2696
+ # perform_enqueued_jobs(only: MyJob) do
2697
+ # MyJob.perform_later(1, 2, 3) # will be performed
2698
+ # HelloJob.perform_later(1, 2, 3) # will not be performed
2699
+ # end
2700
+ # assert_performed_jobs 1
2701
+ # end
2702
+ #
2703
+ # Also if the +:except+ option is specified,
2704
+ # then the job(s) except specific class will be performed.
2705
+ #
2706
+ # def test_perform_enqueued_jobs_with_except
2707
+ # perform_enqueued_jobs(except: HelloJob) do
2708
+ # MyJob.perform_later(1, 2, 3) # will be performed
2709
+ # HelloJob.perform_later(1, 2, 3) # will not be performed
2710
+ # end
2711
+ # assert_performed_jobs 1
2712
+ # end
2713
+ #
2714
+ # +:only+ and +:except+ options accept Class, Array of Class, or Proc. When passed a Proc,
2715
+ # an instance of the job will be passed as argument.
2716
+ #
2717
+ # If the +:queue+ option is specified,
2718
+ # then only the job(s) enqueued to a specific queue will be performed.
2719
+ #
2720
+ # def test_perform_enqueued_jobs_with_queue
2721
+ # perform_enqueued_jobs queue: :some_queue do
2722
+ # MyJob.set(queue: :some_queue).perform_later(1, 2, 3) # will be performed
2723
+ # HelloJob.set(queue: :other_queue).perform_later(1, 2, 3) # will not be performed
2724
+ # end
2725
+ # assert_performed_jobs 1
2726
+ # end
2727
+ #
2728
+ # If the +:at+ option is specified, then only jobs that have been enqueued
2729
+ # to run at or before the given time will be performed. This includes jobs
2730
+ # that have been enqueued without a time.
2731
+ #
2732
+ # If queue_adapter_for_test is overridden to return a different adapter,
2733
+ # +perform_enqueued_jobs+ will merely execute the block.
2734
+ #
2735
+ # source://activejob//lib/active_job/test_helper.rb#620
2736
+ def perform_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end
2737
+
2738
+ # source://activejob//lib/active_job/test_helper.rb#9
2739
+ def performed_jobs(*_arg0, **_arg1, &_arg2); end
2740
+
2741
+ # source://activejob//lib/active_job/test_helper.rb#9
2742
+ def performed_jobs=(arg); end
2743
+
2744
+ # Accesses the queue_adapter set by ActiveJob::Base.
2745
+ #
2746
+ # def test_assert_job_has_custom_queue_adapter_set
2747
+ # assert_instance_of CustomQueueAdapter, HelloJob.queue_adapter
2748
+ # end
2749
+ #
2750
+ # source://activejob//lib/active_job/test_helper.rb#661
2751
+ def queue_adapter; end
2752
+
2753
+ # Returns a queue adapter instance to use with all Active Job test helpers.
2754
+ # By default, returns an instance of ActiveJob::QueueAdapters::TestAdapter.
2755
+ # Override this method to specify a different adapter. The adapter must
2756
+ # implement the same interface as ActiveJob::QueueAdapters::TestAdapter.
2757
+ #
2758
+ # source://activejob//lib/active_job/test_helper.rb#66
2759
+ def queue_adapter_for_test; end
2760
+
2761
+ private
2762
+
2763
+ # source://activejob//lib/active_job/test_helper.rb#676
2764
+ def clear_enqueued_jobs; end
2765
+
2766
+ # source://activejob//lib/active_job/test_helper.rb#680
2767
+ def clear_performed_jobs; end
2768
+
2769
+ # source://activejob//lib/active_job/test_helper.rb#745
2770
+ def deserialize_args_for_assertion(job); end
2771
+
2772
+ # source://activejob//lib/active_job/test_helper.rb#716
2773
+ def enqueued_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil), &block); end
2774
+
2775
+ # source://activejob//lib/active_job/test_helper.rb#710
2776
+ def filter_as_proc(filter); end
2777
+
2778
+ # source://activejob//lib/active_job/test_helper.rb#724
2779
+ def flush_enqueued_jobs(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end
2780
+
2781
+ # source://activejob//lib/active_job/test_helper.rb#752
2782
+ def instantiate_job(payload, skip_deserialize_arguments: T.unsafe(nil)); end
2783
+
2784
+ # source://activejob//lib/active_job/test_helper.rb#684
2785
+ def jobs_with(jobs, only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), at: T.unsafe(nil)); end
2786
+
2787
+ # source://activejob//lib/active_job/test_helper.rb#720
2788
+ def performed_jobs_with(only: T.unsafe(nil), except: T.unsafe(nil), queue: T.unsafe(nil), &block); end
2789
+
2790
+ # source://activejob//lib/active_job/test_helper.rb#732
2791
+ def prepare_args_for_assertion(args); end
2792
+
2793
+ # source://activejob//lib/active_job/test_helper.rb#759
2794
+ def queue_adapter_changed_jobs; end
2795
+
2796
+ # source://activejob//lib/active_job/test_helper.rb#666
2797
+ def require_active_job_test_adapter!(method); end
2798
+
2799
+ # @return [Boolean]
2800
+ #
2801
+ # source://activejob//lib/active_job/test_helper.rb#672
2802
+ def using_test_adapter?; end
2803
+
2804
+ # @raise [ArgumentError]
2805
+ #
2806
+ # source://activejob//lib/active_job/test_helper.rb#766
2807
+ def validate_option(only: T.unsafe(nil), except: T.unsafe(nil)); end
2808
+ end
2809
+
2810
+ # source://activejob//lib/active_job/test_helper.rb#15
2811
+ module ActiveJob::TestHelper::TestQueueAdapter
2812
+ extend ::ActiveSupport::Concern
2813
+ include GeneratedInstanceMethods
2814
+
2815
+ mixes_in_class_methods GeneratedClassMethods
2816
+ mixes_in_class_methods ::ActiveJob::TestHelper::TestQueueAdapter::ClassMethods
2817
+
2818
+ module GeneratedClassMethods
2819
+ def _test_adapter; end
2820
+ def _test_adapter=(value); end
2821
+ end
2822
+
2823
+ module GeneratedInstanceMethods; end
2824
+ end
2825
+
2826
+ # source://activejob//lib/active_job/test_helper.rb#22
2827
+ module ActiveJob::TestHelper::TestQueueAdapter::ClassMethods
2828
+ # source://activejob//lib/active_job/test_helper.rb#27
2829
+ def disable_test_adapter; end
2830
+
2831
+ # source://activejob//lib/active_job/test_helper.rb#31
2832
+ def enable_test_adapter(test_adapter); end
2833
+
2834
+ # source://activejob//lib/active_job/test_helper.rb#23
2835
+ def queue_adapter; end
2836
+ end
2837
+
2838
+ # source://activejob//lib/active_job/timezones.rb#4
2839
+ module ActiveJob::Timezones
2840
+ extend ::ActiveSupport::Concern
2841
+ end
2842
+
2843
+ # source://activejob//lib/active_job/translation.rb#4
2844
+ module ActiveJob::Translation
2845
+ extend ::ActiveSupport::Concern
2846
+ end
2847
+
2848
+ # source://activejob//lib/active_job/gem_version.rb#9
2849
+ module ActiveJob::VERSION; end
2850
+
2851
+ # source://activejob//lib/active_job/gem_version.rb#10
2852
+ ActiveJob::VERSION::MAJOR = T.let(T.unsafe(nil), Integer)
2853
+
2854
+ # source://activejob//lib/active_job/gem_version.rb#11
2855
+ ActiveJob::VERSION::MINOR = T.let(T.unsafe(nil), Integer)
2856
+
2857
+ # source://activejob//lib/active_job/gem_version.rb#13
2858
+ ActiveJob::VERSION::PRE = T.let(T.unsafe(nil), T.untyped)
2859
+
2860
+ # source://activejob//lib/active_job/gem_version.rb#15
2861
+ ActiveJob::VERSION::STRING = T.let(T.unsafe(nil), String)
2862
+
2863
+ # source://activejob//lib/active_job/gem_version.rb#12
2864
+ ActiveJob::VERSION::TINY = T.let(T.unsafe(nil), Integer)