-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using executors incorrectly. #115
Comments
Hi, thank you for your comments. This looks to be a valid issue and the team is actively looking into it. We will update this issue when a fix is in place. |
Hi @georgantasp , the SDK's HttpUtility postData method is written that way for the following reasons: |
Hi, I'm pretty far removed from this concern at this point, but if I have time, I'll put together a PR to show you want I mean. a. Creating new threads is expensive. The point of the executors package is to make it easy for developers to work with thread pools. In this way, a pool of 10 threads (for example) can be created and reused. I would encourage you to read "Java Concurrency In Practice" http://jcip.net/ . It's a great resource for learning more. |
The SDK's HttpUtility is needlessly creating threads for every request execution.
This is creating a new thread for every execution. EXPENSIVE!
I could be wrong, but I think it's a race condition where to assume the HTTPCallTask is started before the executor gets shutdown.
Waiting on future.get() which means no call is ever asynchronous.
The text was updated successfully, but these errors were encountered: