Fork me on GitHub
#core-async
<
2017-06-06
>
luxbock09:06:19

I have a list of files that I need to run a validation procedure that in most cases takes a few seconds, but might take upto 15 in rare cases, and I would like to run this validation in parallel on two files at a time, and then do further processing based on the result

luxbock09:06:51

am I right in assuming that pipeline-blocking ran with a parallelism count of 2 would need to always wait for both validation procedures to finish before proceding to accept more values, because it maintains order?

noisesmith18:06:42

yeah, if you don’t care about order just put some promise-chans in a set, use alts! and remove them as they complete

noisesmith18:06:57

maybe there’s something simpler? but that should be pretty straightforward

noisesmith18:06:40

actually - you don’t even need promise-chans, just make a set of async/thread calls, each one returns a chan

hiredman18:06:12

I'd use an Executor and an ExecutorCompletionService

hiredman18:06:10

you don't care about order, and there is no feedback in to the list that is the source of the data