public static CloseableHttpAsyncClient createSimpleClient() {

        CloseableHttpAsyncClient httpclient =
                        HttpAsyncClients.custom()
                        .build();
        
        return httpclient;
}

public static void main(String[] args) throws IOException {

List<CloseableHttpAsyncClient> clients = new ArrayList<CloseableHttpAsyncClient>();

        for (int i = 0; i < 10; i++) {
                System.out.println(i + "\t" + Thread.activeCount());
                
                CloseableHttpAsyncClient client = createSimpleClient();
                client.start();
                clients.add(client);
                
                try {
                        Thread.sleep(1000);
                } catch (InterruptedException e) {
                        e.printStackTrace();
                }
        }
        
        System.out.println(Thread.activeCount());
}

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to