hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malaka Gallage <mpgall...@gmail.com>
Subject Re: Adding a Callback to Trigger on Reusing a Connection
Date Tue, 11 Nov 2014 09:58:45 GMT
Hi Oleg,

A pull request is made as per the suggestion.
https://github.com/apache/httpcore/pull/6

Thanks
Malaka

On Mon, Nov 10, 2014 at 7:08 PM, Oleg Kalnichevski <olegk@apache.org> wrote:

> 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: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>


-- 


Regards,



*Malaka GallageSoftware Engineer*


*AdroitLogic Lanka (Pvt) Ltd.*
[image: Facebook] <https://www.facebook.com/malaka.gallage> [image: Twitter]
<http://twitter.com/#%21/MalakaGallage> [image: LinkedIn]
<http://www.linkedin.com/profile/view?id=91872322&trk=tab_pro> [image:
Blogger] <http://swordofpoet.blogspot.com/>
Skype :  malaka.gallage
Mobile : +94 718 796 378

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message