@@ -6,7 +6,7 @@ struct BatchProcessingError <: Exception
6
6
end
7
7
8
8
"""
9
- pgenerate([::WorkerPool ], f, c...) -> iterator
9
+ pgenerate([::AbstractWorkerPool ], f, c...) -> iterator
10
10
11
11
Apply `f` to each element of `c` in parallel using available workers and tasks.
12
12
@@ -18,14 +18,14 @@ Note that `f` must be made available to all worker processes; see
18
18
[Code Availability and Loading Packages](@ref code-availability)
19
19
for details.
20
20
"""
21
- function pgenerate (p:: WorkerPool , f, c)
21
+ function pgenerate (p:: AbstractWorkerPool , f, c)
22
22
if length (p) == 0
23
23
return AsyncGenerator (f, c; ntasks= ()-> nworkers (p))
24
24
end
25
25
batches = batchsplit (c, min_batch_count = length (p) * 3 )
26
26
return Iterators. flatten (AsyncGenerator (remote (p, b -> asyncmap (f, b)), batches))
27
27
end
28
- pgenerate (p:: WorkerPool , f, c1, c... ) = pgenerate (p, a-> f (a... ), zip (c1, c... ))
28
+ pgenerate (p:: AbstractWorkerPool , f, c1, c... ) = pgenerate (p, a-> f (a... ), zip (c1, c... ))
29
29
pgenerate (f, c) = pgenerate (default_worker_pool (), f, c)
30
30
pgenerate (f, c1, c... ) = pgenerate (a-> f (a... ), zip (c1, c... ))
31
31
0 commit comments