minio-java icon indicating copy to clipboard operation
minio-java copied to clipboard

Add injection of custom executor service to S3Base supplyAsync calls

Open delta11 opened this issue 11 months ago • 4 comments

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 avatar Mar 18 '24 11:03 delta11

@delta11 refer https://github.com/minio/minio-java/issues/1569

can you give some advice about this issue.

chenshi5012 avatar Jun 19 '24 08:06 chenshi5012

@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.

delta11 avatar Jun 21 '24 06:06 delta11

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.

balamurugana avatar Jul 08 '24 06:07 balamurugana

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!

delta11 avatar Jul 08 '24 07:07 delta11