Proposal: Managing the Lifecycle of THREAD_POOL in Azure Table Storage Java SDK #40107
luxianlong
started this conversation in
General
Replies: 1 comment 1 reply
-
Thanks for starting this discussion @luxianlong, this is something that we're looking at right now. We recently added a centralized ExecutorService into our And at one part during the implementation, I did have a way to set an external ExecutorService that would be used instead of one managed by the Azure SDK itself. Would you mind opening this up as an issue? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Azure SDK Community,
I've been working with the Azure Table Storage Java SDK and encountered a scenario that I believe could benefit from a discussion and potential enhancement. Specifically, I'm referring to the management of the THREAD_POOL used in the TableClient and TableAsyncClient classes for handling asynchronous operations.
As it stands, the SDK initializes a static THREAD_POOL using Executors.newCachedThreadPool() and registers a JVM shutdown hook to clean up the thread pool. This approach generally works well for straightforward applications. However, it poses challenges in scenarios where the application has specific requirements for shutdown behavior or needs to manage the thread pool lifecycle more granitely.
For example, in my case, I need to perform certain operations against Azure Table Storage within my application's shutdown hook. The current implementation of the SDK's thread pool management doesn't easily allow for this, as the thread pool may be shut down before my shutdown logic executes.
I propose we discuss potential enhancements to the SDK that would give developers more control over the thread pool's lifecycle. Some ideas could include:
I'm interested in hearing the community's thoughts on this matter.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions