On Mon, 2014-11-10 at 17:33 +0530, Malaka Gallage wrote:
> Hello everyone,
>
> I'm using NIO version 4.2.5 and I'm facing a little problem. I have some
> operations to be executed on HttpAsyncRequestExecutor#connected and I have
> implemented those operations now. But the problem occurs when I use
> keepalive connections. I want these operations to be executed on reusing an
> established connection from the pool too.
>
> To achieve this, I have added a callback method called onReusingPoolEntry()
> to AbstractNIOConnPool which is executed when reusing an established
> connection from the pool.
>
> Code :
>
> private boolean processPendingRequest(final LeaseRequest<T, C, E> request) {
> ..................
> ........
> if (entry != null) {
> this.available.remove(entry);
> this.leased.add(entry);
> future.completed(entry);
> onReusingPoolEntry(entry);
> return true;
> }
> .........
> .................
> }
>
> protected void onReusingPoolEntry(E entry) {}
>
> I suggest to add this feature to the NIO code base too. WDYT?
>
> Thanks
> Malaka
>
Sounds reasonable enough. Feel free to raise a PR at GitHub for this
change. Please note that you should be working with the 4.4.x branch,
which is to become the official stable branch soon.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]