Can't increase max concurrent Gdx.net HTTP requests
See original GitHub issuePlease ensure you have given all the following requested information in your report.
Issue details
My app is triggering two HTTP requests, one of which might take a few seconds to load. I noticed however that the second request is not issued, until the first one completes. I would like for these HTTP calls to be made in parallel.Please provide the details of your issue
Reproduction steps/code
Looking in the code, the NetJavaImpl
uses an new AsyncExecutor(1);
, where 1 is the max concurrent requests. I would like to increase this (ie. to 2 or 3), however it doesn’t seem to be possible since it is hard coded to 1.
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/net/NetJavaImpl.java#L127
What would you recommend in order to make it possible to shoot multiple parallel HTTP requests to the server?
Version of LibGDX and/or relevant dependencies
1.9.6
Stacktrace
Please select the affected platforms
- Android
- iOS (robovm)
- iOS (MOE)
- HTML/GWT
- Windows
- Linux
- MacOS
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
I would go for unbounded newCachedThreadPool which is IMO the common use case. Only few edge cases need to limit thread pool.
Sounds good to me.
I would add a note in changes.md to explain this is a breaking change : maybe some client code rely on the old thread limit.