Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Simao Mata
Ah ok, that's what I was looking for. Thank you. On 6 July 2015 at 11:46, Oleg Kalnichevski wrote: > On Mon, 2015-07-06 at 11:41 +0200, Simao Mata wrote: > > Even if the execute calls are can be minutes or even hours apart? When I > > call execute I don't know when the next call will be, can be

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Oleg Kalnichevski
On Mon, 2015-07-06 at 11:41 +0200, Simao Mata wrote: > Even if the execute calls are can be minutes or even hours apart? When I > call execute I don't know when the next call will be, can be milliseconds > or hours. Should I call close anyway? > No, you should not. You can evict persistent connec

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Oleg Kalnichevski
On Mon, 2015-07-06 at 11:40 +0200, Simao Mata wrote: > Yes, but that calls close, and I wanted to know if I do need to call close. > You need to call #close if you want to close. Oleg > On 6 July 2015 at 10:31, Stefan Magnus Landrø > wrote: > > > > > https://docs.oracle.com/javase/tutorial/es

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Simao Mata
Even if the execute calls are can be minutes or even hours apart? When I call execute I don't know when the next call will be, can be milliseconds or hours. Should I call close anyway? Thanks On 6 July 2015 at 10:51, Oleg Kalnichevski wrote: > On Mon, 2015-07-06 at 10:03 +0200, Simao Mata wrote

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Simao Mata
Yes, but that calls close, and I wanted to know if I do need to call close. On 6 July 2015 at 10:31, Stefan Magnus Landrø wrote: > > https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html > > 2015-07-06 10:29 GMT+02:00 Simao Mata : > > > Sorry, I don't understand what

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Oleg Kalnichevski
On Mon, 2015-07-06 at 10:03 +0200, Simao Mata wrote: > Hello, > > In the examples for the async hc version, I noticed the `close()` is always > called after using the `CloseableHttpAsyncClient` instance, inside a > `finally` block. > > I want to to reuse the `httpclient` instance, I always POST t

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Stefan Magnus Landrø
https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html 2015-07-06 10:29 GMT+02:00 Simao Mata : > Sorry, I don't understand what you mean? > > On 6 July 2015 at 10:17, Stefan Magnus Landrø > wrote: > > > try with resources in java will automatically call close(). > > >

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Simao Mata
Sorry, I don't understand what you mean? On 6 July 2015 at 10:17, Stefan Magnus Landrø wrote: > try with resources in java will automatically call close(). > > > 2015-07-06 10:03 GMT+02:00 Simao Mata : > > > Hello, > > > > In the examples for the async hc version, I noticed the `close()` is > al

Re: Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Stefan Magnus Landrø
try with resources in java will automatically call close(). 2015-07-06 10:03 GMT+02:00 Simao Mata : > Hello, > > In the examples for the async hc version, I noticed the `close()` is always > called after using the `CloseableHttpAsyncClient` instance, inside a > `finally` block. > > I want to to

Releasing resources when using CloseableHttpAsyncClient

2015-07-06 Thread Simao Mata
Hello, In the examples for the async hc version, I noticed the `close()` is always called after using the `CloseableHttpAsyncClient` instance, inside a `finally` block. I want to to reuse the `httpclient` instance, I always POST to the same url, so I want hc to try reusing the connection each tim