While this looks useful, the example is precisely the sort of problem for which threads aren't useful.
Parallel IO doesn't (necessarily) need to use threads and an explicitly async API is more flexible and usually easier to understand, especially with CSP like core.async.
It's true that parallel IO has less overhead with an asynchronous API, but I disagree about it being easier to understand. You have to set up callbacks or start your processes and then wait, and you have to work harder to manage the degree of parallelism.
If parallel IO was all we needed to do, asynchronous APIs would be the sensible choice, but for managing parallelism while chaining IO & CPU work, sharing pools across multiple simultaneous requests, Claypoole's a pretty nice tool.
Comments
While this looks useful, the example is precisely the sort of problem for which threads aren't useful.
Parallel IO doesn't (necessarily) need to use threads and an explicitly async API is more flexible and usually easier to understand, especially with CSP like core.async.
It's true that parallel IO has less overhead with an asynchronous API, but I disagree about it being easier to understand. You have to set up callbacks or start your processes and then wait, and you have to work harder to manage the degree of parallelism.
If parallel IO was all we needed to do, asynchronous APIs would be the sensible choice, but for managing parallelism while chaining IO & CPU work, sharing pools across multiple simultaneous requests, Claypoole's a pretty nice tool.