redis-promise 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 (48) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ci.yml +74 -0
  3. data/CHANGELOG.md +19 -0
  4. data/LICENSE +21 -0
  5. data/README.md +151 -0
  6. data/Rakefile +12 -0
  7. data/lib/redis/promise/resolver.rb +47 -0
  8. data/lib/redis/promise/resque.rb +49 -0
  9. data/lib/redis/promise/version.rb +8 -0
  10. data/lib/redis/promise.rb +83 -0
  11. data/sorbet/config +7 -0
  12. data/sorbet/rbi/annotations/.gitattributes +1 -0
  13. data/sorbet/rbi/annotations/minitest.rbi +120 -0
  14. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  15. data/sorbet/rbi/gems/.gitattributes +1 -0
  16. data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
  17. data/sorbet/rbi/gems/byebug@13.0.0.rbi +37 -0
  18. data/sorbet/rbi/gems/connection_pool@3.0.2.rbi +340 -0
  19. data/sorbet/rbi/gems/date@3.5.1.rbi +403 -0
  20. data/sorbet/rbi/gems/erb@6.0.4.rbi +814 -0
  21. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  22. data/sorbet/rbi/gems/json@2.19.5.rbi +2250 -0
  23. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
  24. data/sorbet/rbi/gems/minitest@5.27.0.rbi +1549 -0
  25. data/sorbet/rbi/gems/parallel@2.1.0.rbi +359 -0
  26. data/sorbet/rbi/gems/pp@0.6.3.rbi +388 -0
  27. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  28. data/sorbet/rbi/gems/psych@5.3.1.rbi +2555 -0
  29. data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
  30. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  31. data/sorbet/rbi/gems/rake@13.4.2.rbi +3258 -0
  32. data/sorbet/rbi/gems/redis-client@0.29.0.rbi +1203 -0
  33. data/sorbet/rbi/gems/redis@5.4.1.rbi +3552 -0
  34. data/sorbet/rbi/gems/reline@0.6.3.rbi +2995 -0
  35. data/sorbet/rbi/gems/rubocop-espago@1.2.0.rbi +9 -0
  36. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  37. data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +563 -0
  38. data/sorbet/rbi/gems/stringio@3.2.0.rbi +9 -0
  39. data/sorbet/rbi/gems/tsort@0.2.0.rbi +393 -0
  40. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +132 -0
  41. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +254 -0
  42. data/sorbet/rbi/shims/gems/resque.rbi +9 -0
  43. data/sorbet/rbi/shims/gems/shoulda-context.rbi +16 -0
  44. data/sorbet/rbi/todo.rbi +5 -0
  45. data/sorbet/tapioca/config.yml +31 -0
  46. data/sorbet/tapioca/extensions/load_gem.rb +1 -0
  47. data/sorbet/tapioca/require.rb +5 -0
  48. metadata +117 -0
@@ -0,0 +1,359 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `parallel` gem.
5
+ # Please instead update this file by running `bin/tapioca gem parallel`.
6
+
7
+
8
+ # source://parallel//lib/parallel/version.rb#2
9
+ module Parallel
10
+ class << self
11
+ # @return [Boolean]
12
+ #
13
+ # source://parallel//lib/parallel.rb#256
14
+ def all?(*args, &block); end
15
+
16
+ # @return [Boolean]
17
+ #
18
+ # source://parallel//lib/parallel.rb#251
19
+ def any?(*args, &block); end
20
+
21
+ # source://parallel//lib/parallel.rb#247
22
+ def each(array, options = T.unsafe(nil), &block); end
23
+
24
+ # source://parallel//lib/parallel.rb#261
25
+ def each_with_index(array, options = T.unsafe(nil), &block); end
26
+
27
+ # source://parallel//lib/parallel.rb#320
28
+ def filter_map(*_arg0, **_arg1, &_arg2); end
29
+
30
+ # source://parallel//lib/parallel.rb#316
31
+ def flat_map(*_arg0, **_arg1, &_arg2); end
32
+
33
+ # source://parallel//lib/parallel.rb#241
34
+ def in_processes(options = T.unsafe(nil), &block); end
35
+
36
+ # source://parallel//lib/parallel.rb#225
37
+ def in_threads(options = T.unsafe(nil)); end
38
+
39
+ # source://parallel//lib/parallel.rb#265
40
+ def map(source, options = T.unsafe(nil), &block); end
41
+
42
+ # source://parallel//lib/parallel.rb#312
43
+ def map_with_index(array, options = T.unsafe(nil), &block); end
44
+
45
+ # Number of physical processor cores on the current system.
46
+ #
47
+ # source://parallel//lib/parallel.rb#325
48
+ def physical_processor_count; end
49
+
50
+ # Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup,
51
+ # used for process scheduling
52
+ #
53
+ # source://parallel//lib/parallel.rb#355
54
+ def processor_count; end
55
+
56
+ # source://parallel//lib/parallel.rb#359
57
+ def worker_number; end
58
+
59
+ # TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed
60
+ #
61
+ # source://parallel//lib/parallel.rb#364
62
+ def worker_number=(worker_num); end
63
+
64
+ private
65
+
66
+ # source://parallel//lib/parallel.rb#397
67
+ def add_progress_bar!(job_factory, options); end
68
+
69
+ # source://parallel//lib/parallel.rb#738
70
+ def available_processor_count; end
71
+
72
+ # source://parallel//lib/parallel.rb#686
73
+ def call_with_index(item, index, options, &block); end
74
+
75
+ # source://parallel//lib/parallel.rb#616
76
+ def create_workers(job_factory, options, &block); end
77
+
78
+ # options is either a Integer or a Hash with :count
79
+ #
80
+ # source://parallel//lib/parallel.rb#676
81
+ def extract_count_from_options(options); end
82
+
83
+ # source://parallel//lib/parallel.rb#704
84
+ def instrument_finish(item, index, result, options); end
85
+
86
+ # yield results in the order of the input items
87
+ # needs to use `options` to store state between executions
88
+ # needs to use `done` index since a nil result would also be valid
89
+ #
90
+ # source://parallel//lib/parallel.rb#713
91
+ def instrument_finish_in_order(item, index, result, options); end
92
+
93
+ # source://parallel//lib/parallel.rb#733
94
+ def instrument_start(item, index, options); end
95
+
96
+ # source://parallel//lib/parallel.rb#370
97
+ def physical_processor_count_windows; end
98
+
99
+ # source://parallel//lib/parallel.rb#651
100
+ def process_incoming_jobs(read, write, job_factory, options, &block); end
101
+
102
+ # source://parallel//lib/parallel.rb#526
103
+ def ractor_build(use_port); end
104
+
105
+ # source://parallel//lib/parallel.rb#547
106
+ def ractor_result(item, index, result, results, results_mutex, options); end
107
+
108
+ # source://parallel//lib/parallel.rb#552
109
+ def ractor_stop(ractor); end
110
+
111
+ # source://parallel//lib/parallel.rb#604
112
+ def replace_worker(job_factory, workers, index, options, blk); end
113
+
114
+ # source://parallel//lib/parallel.rb#391
115
+ def run(command); end
116
+
117
+ # source://parallel//lib/parallel.rb#697
118
+ def with_instrumentation(item, index, options); end
119
+
120
+ # source://parallel//lib/parallel.rb#422
121
+ def work_direct(job_factory, options, &block); end
122
+
123
+ # source://parallel//lib/parallel.rb#556
124
+ def work_in_processes(job_factory, options, &blk); end
125
+
126
+ # source://parallel//lib/parallel.rb#466
127
+ def work_in_ractors(job_factory, options); end
128
+
129
+ # source://parallel//lib/parallel.rb#441
130
+ def work_in_threads(job_factory, options, &block); end
131
+
132
+ # source://parallel//lib/parallel.rb#624
133
+ def worker(job_factory, options, &block); end
134
+ end
135
+ end
136
+
137
+ # source://parallel//lib/parallel.rb#12
138
+ class Parallel::Break < ::StandardError
139
+ # @return [Break] a new instance of Break
140
+ #
141
+ # source://parallel//lib/parallel.rb#15
142
+ def initialize(value = T.unsafe(nil)); end
143
+
144
+ # marshal_dump that is used for ruby exceptions
145
+ # avoid dumping the cause since nobody needs that and it can include undumpable exceptions
146
+ #
147
+ # source://parallel//lib/parallel.rb#22
148
+ def _dump(_depth); end
149
+
150
+ # Returns the value of attribute value.
151
+ #
152
+ # source://parallel//lib/parallel.rb#13
153
+ def value; end
154
+
155
+ class << self
156
+ # marshal_load that is used for ruby exceptions
157
+ #
158
+ # source://parallel//lib/parallel.rb#27
159
+ def _load(data); end
160
+ end
161
+ end
162
+
163
+ # source://parallel//lib/parallel.rb#9
164
+ class Parallel::DeadWorker < ::StandardError; end
165
+
166
+ # source://parallel//lib/parallel.rb#44
167
+ class Parallel::ExceptionWrapper
168
+ # @return [ExceptionWrapper] a new instance of ExceptionWrapper
169
+ #
170
+ # source://parallel//lib/parallel.rb#47
171
+ def initialize(exception); end
172
+
173
+ # Returns the value of attribute exception.
174
+ #
175
+ # source://parallel//lib/parallel.rb#45
176
+ def exception; end
177
+ end
178
+
179
+ # source://parallel//lib/parallel.rb#111
180
+ class Parallel::JobFactory
181
+ # @return [JobFactory] a new instance of JobFactory
182
+ #
183
+ # source://parallel//lib/parallel.rb#112
184
+ def initialize(source, mutex); end
185
+
186
+ # source://parallel//lib/parallel.rb#120
187
+ def next; end
188
+
189
+ # generate item that is sent to workers
190
+ # just index is faster + less likely to blow up with unserializable errors
191
+ #
192
+ # source://parallel//lib/parallel.rb#149
193
+ def pack(item, index); end
194
+
195
+ # source://parallel//lib/parallel.rb#139
196
+ def size; end
197
+
198
+ # unpack item that is sent to workers
199
+ #
200
+ # source://parallel//lib/parallel.rb#154
201
+ def unpack(data); end
202
+
203
+ private
204
+
205
+ # @return [Boolean]
206
+ #
207
+ # source://parallel//lib/parallel.rb#160
208
+ def producer?; end
209
+
210
+ # source://parallel//lib/parallel.rb#164
211
+ def queue_wrapper(array); end
212
+ end
213
+
214
+ # source://parallel//lib/parallel.rb#32
215
+ class Parallel::Kill < ::Parallel::Break; end
216
+
217
+ # Pluggable wire serializers. Each must respond to `dump(data, io)` /
218
+ # `load(io)` (used directly by Worker) and `dump(data)` / `load(string)`
219
+ # (used by wrappers like Hmac).
220
+ #
221
+ # source://parallel//lib/parallel/serializer.rb#9
222
+ module Parallel::Serializer; end
223
+
224
+ # Wraps any inner serializer with a length-prefixed HMAC-SHA256 frame keyed
225
+ # on a per-worker secret generated before fork. Forged frames from a
226
+ # pipe-injector fail verification.
227
+ #
228
+ # source://parallel//lib/parallel/serializer.rb#17
229
+ class Parallel::Serializer::Hmac
230
+ # @return [Hmac] a new instance of Hmac
231
+ #
232
+ # source://parallel//lib/parallel/serializer.rb#22
233
+ def initialize(inner: T.unsafe(nil), secret: T.unsafe(nil)); end
234
+
235
+ # source://parallel//lib/parallel/serializer.rb#27
236
+ def dump(data, io); end
237
+
238
+ # @raise [SecurityError]
239
+ #
240
+ # source://parallel//lib/parallel/serializer.rb#33
241
+ def load(io); end
242
+ end
243
+
244
+ # source://parallel//lib/parallel/serializer.rb#19
245
+ Parallel::Serializer::Hmac::LENGTH_BYTES = T.let(T.unsafe(nil), Integer)
246
+
247
+ # 32-bit big-endian unsigned int
248
+ #
249
+ # source://parallel//lib/parallel/serializer.rb#18
250
+ Parallel::Serializer::Hmac::LENGTH_FORMAT = T.let(T.unsafe(nil), String)
251
+
252
+ # SHA256
253
+ #
254
+ # source://parallel//lib/parallel/serializer.rb#20
255
+ Parallel::Serializer::Hmac::MAC_BYTES = T.let(T.unsafe(nil), Integer)
256
+
257
+ # Raw Marshal. Fast but trusts anything written to the pipe — a same-UID
258
+ # attacker that reopens /proc/<pid>/fd/<n> can inject Marshal gadgets (RCE).
259
+ #
260
+ # source://parallel//lib/parallel/serializer.rb#12
261
+ Parallel::Serializer::Marshal = Marshal
262
+
263
+ # source://parallel//lib/parallel.rb#7
264
+ Parallel::Stop = T.let(T.unsafe(nil), Object)
265
+
266
+ # source://parallel//lib/parallel.rb#35
267
+ class Parallel::UndumpableException < ::StandardError
268
+ # @return [UndumpableException] a new instance of UndumpableException
269
+ #
270
+ # source://parallel//lib/parallel.rb#38
271
+ def initialize(original); end
272
+
273
+ # Returns the value of attribute backtrace.
274
+ #
275
+ # source://parallel//lib/parallel.rb#36
276
+ def backtrace; end
277
+ end
278
+
279
+ # source://parallel//lib/parallel.rb#169
280
+ class Parallel::UserInterruptHandler
281
+ class << self
282
+ # source://parallel//lib/parallel.rb#194
283
+ def kill(thing); end
284
+
285
+ # kill all these pids or threads if user presses Ctrl+c
286
+ #
287
+ # source://parallel//lib/parallel.rb#174
288
+ def kill_on_ctrl_c(pids, options); end
289
+
290
+ private
291
+
292
+ # source://parallel//lib/parallel.rb#218
293
+ def restore_interrupt(old, signal); end
294
+
295
+ # source://parallel//lib/parallel.rb#203
296
+ def trap_interrupt(signal); end
297
+ end
298
+ end
299
+
300
+ # source://parallel//lib/parallel.rb#170
301
+ Parallel::UserInterruptHandler::INTERRUPT_SIGNAL = T.let(T.unsafe(nil), Symbol)
302
+
303
+ # source://parallel//lib/parallel/version.rb#3
304
+ Parallel::VERSION = T.let(T.unsafe(nil), String)
305
+
306
+ # source://parallel//lib/parallel/version.rb#3
307
+ Parallel::Version = T.let(T.unsafe(nil), String)
308
+
309
+ # source://parallel//lib/parallel.rb#63
310
+ class Parallel::Worker
311
+ # @return [Worker] a new instance of Worker
312
+ #
313
+ # source://parallel//lib/parallel.rb#67
314
+ def initialize(read, write, pid, serializer); end
315
+
316
+ # might be passed to started_processes and simultaneously closed by another thread
317
+ # when running in isolation mode, so we have to check if it is closed before closing
318
+ #
319
+ # source://parallel//lib/parallel.rb#81
320
+ def close_pipes; end
321
+
322
+ # Returns the value of attribute pid.
323
+ #
324
+ # source://parallel//lib/parallel.rb#64
325
+ def pid; end
326
+
327
+ # Returns the value of attribute read.
328
+ #
329
+ # source://parallel//lib/parallel.rb#64
330
+ def read; end
331
+
332
+ # source://parallel//lib/parallel.rb#74
333
+ def stop; end
334
+
335
+ # Returns the value of attribute thread.
336
+ #
337
+ # source://parallel//lib/parallel.rb#65
338
+ def thread; end
339
+
340
+ # Sets the attribute thread
341
+ #
342
+ # @param value the value to set the attribute thread to.
343
+ #
344
+ # source://parallel//lib/parallel.rb#65
345
+ def thread=(_arg0); end
346
+
347
+ # source://parallel//lib/parallel.rb#86
348
+ def work(data); end
349
+
350
+ # Returns the value of attribute write.
351
+ #
352
+ # source://parallel//lib/parallel.rb#64
353
+ def write; end
354
+
355
+ private
356
+
357
+ # source://parallel//lib/parallel.rb#104
358
+ def wait; end
359
+ end