is it possible to batch/partition arbitrary rules,...
# plugins
e
is it possible to batch/partition arbitrary rules, not just things like test/lint/fix goals? if so, is there a good example in core that someone can point out to me?
f
Yes, but only if you write your own batching logic.
(As you have probably seen, the
test
and
fmt/lint/fix
goals have custom batching logic in their respective APIs.)
The pattern to likely use is to define request / response types for each batch (with a rule to compute the batch). Decompose the work into those batch requests. Then just use
MultiGet
/
concurrently
(for rule by name) to compute them concurrently.
Of course the problem in your case is whether you have all of the targets "at once" to be able to partition.
And this will depend on which goal it is and whether that goal's API feeds your rules one target at a time or all of the targets in a single request.
Which goal did you have in mind to do in batches?
e
this would be a custom goal rule
this makes sense to me
f
Then you should have all of targets available to you.
e
yep
i was overcomplicating it in my head with the partition stuff
but just MultiGet on some set of the targets is good enough
thank you!