I need to create a thread pool of a fixed size and use the thread for every http request. Can anyone specify how to do this?
Thanks in advance
The code is
HttpGet httpGet = new HttpGet(url);
HttpClient httpClient = new DefaultHttpClient();
HttpResponse httpResponse = httpClient.execute(httpGet);
return httpResponse;
Here i need to use the thread from thread pool for every httpresponse
You can use Executors and pass your own Runnable which will process your httpResponse. Code snippet: