minio-java
minio-java copied to clipboard
Add injection of custom executor service to S3Base supplyAsync calls
We have a use case where we need to provide our own thread pool for the CompletableFuture.supplyAsync
to run on, currently that's not possible and it's preventing us from keeping up with library upgrades.
@delta11 refer https://github.com/minio/minio-java/issues/1569
can you give some advice about this issue.
@delta11 refer #1569
can you give some advice about this issue.
Seems like 2 unrelated issues, this one is about giving flexibility to control which executor service get's used not what it get's used for.
Any custom requirements should be done by inheriting S3Base and override whatever methods you want. I am not sure why we need to take this into minio-java.
Any custom requirements should be done by inheriting S3Base and override whatever methods you want. I am not sure why we need to take this into minio-java.
We are in an environment where we can't use the regular ForkJoinPool.commonPool()
(which CompletableFuture.supplyAsync
uses by default).
But in this situation allowing users to optionally supply their own ExecutorService
would be preferable over having to override half a dozen rather methods of S3Base
and the MinioAsyncClient
to change CompletableFuture.supplyAsync(....)
into CompletableFuture.supplyAsync(....,executorService)
.
Though we understand that this is an uncommon requirement, it would still be a great help to us if we can provide our own and I imagine there might be some other niche use cases that would benefit. Let me know what you think!