1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `parallel` gem.
# Please instead update this file by running `bin/tapioca gem parallel`.
# source://parallel//lib/parallel/version.rb#2
module Parallel
class << self
# @return [Boolean]
#
# source://parallel//lib/parallel.rb#243
def all?(*args, &block); end
# @return [Boolean]
#
# source://parallel//lib/parallel.rb#238
def any?(*args, &block); end
# source://parallel//lib/parallel.rb#234
def each(array, options = T.unsafe(nil), &block); end
# source://parallel//lib/parallel.rb#248
def each_with_index(array, options = T.unsafe(nil), &block); end
# source://parallel//lib/parallel.rb#307
def filter_map(*_arg0, **_arg1, &_arg2); end
# source://parallel//lib/parallel.rb#303
def flat_map(*_arg0, **_arg1, &_arg2); end
# source://parallel//lib/parallel.rb#228
def in_processes(options = T.unsafe(nil), &block); end
# source://parallel//lib/parallel.rb#212
def in_threads(options = T.unsafe(nil)); end
# source://parallel//lib/parallel.rb#252
def map(source, options = T.unsafe(nil), &block); end
# source://parallel//lib/parallel.rb#299
def map_with_index(array, options = T.unsafe(nil), &block); end
# Number of physical processor cores on the current system.
#
# source://parallel//lib/parallel.rb#312
def physical_processor_count; end
# Number of processors seen by the OS or value considering CPU quota if the process is inside a cgroup,
# used for process scheduling
#
# source://parallel//lib/parallel.rb#342
def processor_count; end
# source://parallel//lib/parallel.rb#346
def worker_number; end
# TODO: this does not work when doing threads in forks, so should remove and yield the number instead if needed
#
# source://parallel//lib/parallel.rb#351
def worker_number=(worker_num); end
private
# source://parallel//lib/parallel.rb#384
def add_progress_bar!(job_factory, options); end
# source://parallel//lib/parallel.rb#699
def available_processor_count; end
# source://parallel//lib/parallel.rb#647
def call_with_index(item, index, options, &block); end
# source://parallel//lib/parallel.rb#579
def create_workers(job_factory, options, &block); end
# options is either a Integer or a Hash with :count
#
# source://parallel//lib/parallel.rb#637
def extract_count_from_options(options); end
# source://parallel//lib/parallel.rb#665
def instrument_finish(item, index, result, options); end
# yield results in the order of the input items
# needs to use `options` to store state between executions
# needs to use `done` index since a nil result would also be valid
#
# source://parallel//lib/parallel.rb#674
def instrument_finish_in_order(item, index, result, options); end
# source://parallel//lib/parallel.rb#694
def instrument_start(item, index, options); end
# source://parallel//lib/parallel.rb#357
def physical_processor_count_windows; end
# source://parallel//lib/parallel.rb#613
def process_incoming_jobs(read, write, job_factory, options, &block); end
# source://parallel//lib/parallel.rb#567
def replace_worker(job_factory, workers, index, options, blk); end
# source://parallel//lib/parallel.rb#378
def run(command); end
# source://parallel//lib/parallel.rb#658
def with_instrumentation(item, index, options); end
# source://parallel//lib/parallel.rb#409
def work_direct(job_factory, options, &block); end
# source://parallel//lib/parallel.rb#519
def work_in_processes(job_factory, options, &blk); end
# source://parallel//lib/parallel.rb#453
def work_in_ractors(job_factory, options); end
# source://parallel//lib/parallel.rb#428
def work_in_threads(job_factory, options, &block); end
# source://parallel//lib/parallel.rb#587
def worker(job_factory, options, &block); end
end
end
# source://parallel//lib/parallel.rb#11
class Parallel::Break < ::StandardError
# @return [Break] a new instance of Break
#
# source://parallel//lib/parallel.rb#14
def initialize(value = T.unsafe(nil)); end
# Returns the value of attribute value.
#
# source://parallel//lib/parallel.rb#12
def value; end
end
# source://parallel//lib/parallel.rb#8
class Parallel::DeadWorker < ::StandardError; end
# source://parallel//lib/parallel.rb#32
class Parallel::ExceptionWrapper
# @return [ExceptionWrapper] a new instance of ExceptionWrapper
#
# source://parallel//lib/parallel.rb#35
def initialize(exception); end
# Returns the value of attribute exception.
#
# source://parallel//lib/parallel.rb#33
def exception; end
end
# source://parallel//lib/parallel.rb#98
class Parallel::JobFactory
# @return [JobFactory] a new instance of JobFactory
#
# source://parallel//lib/parallel.rb#99
def initialize(source, mutex); end
# source://parallel//lib/parallel.rb#107
def next; end
# generate item that is sent to workers
# just index is faster + less likely to blow up with unserializable errors
#
# source://parallel//lib/parallel.rb#136
def pack(item, index); end
# source://parallel//lib/parallel.rb#126
def size; end
# unpack item that is sent to workers
#
# source://parallel//lib/parallel.rb#141
def unpack(data); end
private
# @return [Boolean]
#
# source://parallel//lib/parallel.rb#147
def producer?; end
# source://parallel//lib/parallel.rb#151
def queue_wrapper(array); end
end
# source://parallel//lib/parallel.rb#20
class Parallel::Kill < ::Parallel::Break; end
# source://parallel//lib/parallel.rb#6
Parallel::Stop = T.let(T.unsafe(nil), Object)
# source://parallel//lib/parallel.rb#23
class Parallel::UndumpableException < ::StandardError
# @return [UndumpableException] a new instance of UndumpableException
#
# source://parallel//lib/parallel.rb#26
def initialize(original); end
# Returns the value of attribute backtrace.
#
# source://parallel//lib/parallel.rb#24
def backtrace; end
end
# source://parallel//lib/parallel.rb#156
class Parallel::UserInterruptHandler
class << self
# source://parallel//lib/parallel.rb#181
def kill(thing); end
# kill all these pids or threads if user presses Ctrl+c
#
# source://parallel//lib/parallel.rb#161
def kill_on_ctrl_c(pids, options); end
private
# source://parallel//lib/parallel.rb#205
def restore_interrupt(old, signal); end
# source://parallel//lib/parallel.rb#190
def trap_interrupt(signal); end
end
end
# source://parallel//lib/parallel.rb#157
Parallel::UserInterruptHandler::INTERRUPT_SIGNAL = T.let(T.unsafe(nil), Symbol)
# source://parallel//lib/parallel/version.rb#3
Parallel::VERSION = T.let(T.unsafe(nil), String)
# source://parallel//lib/parallel/version.rb#3
Parallel::Version = T.let(T.unsafe(nil), String)
# source://parallel//lib/parallel.rb#51
class Parallel::Worker
# @return [Worker] a new instance of Worker
#
# source://parallel//lib/parallel.rb#55
def initialize(read, write, pid); end
# might be passed to started_processes and simultaneously closed by another thread
# when running in isolation mode, so we have to check if it is closed before closing
#
# source://parallel//lib/parallel.rb#68
def close_pipes; end
# Returns the value of attribute pid.
#
# source://parallel//lib/parallel.rb#52
def pid; end
# Returns the value of attribute read.
#
# source://parallel//lib/parallel.rb#52
def read; end
# source://parallel//lib/parallel.rb#61
def stop; end
# Returns the value of attribute thread.
#
# source://parallel//lib/parallel.rb#53
def thread; end
# Sets the attribute thread
#
# @param value the value to set the attribute thread to.
#
# source://parallel//lib/parallel.rb#53
def thread=(_arg0); end
# source://parallel//lib/parallel.rb#73
def work(data); end
# Returns the value of attribute write.
#
# source://parallel//lib/parallel.rb#52
def write; end
private
# source://parallel//lib/parallel.rb#91
def wait; end
end
|