On Sun, 2008-04-06 at 12:29 -0400, Sam Berlin wrote:
> Hi Oleg,
> 
> I agree the name could be much better, so for that reason deprecating
> it is a good idea.  However, I think it's very important to continue
> to include a method that marks a method as recyclable, so that
> responses that are only partially consumed (or completely unread) can
> still be reused for further requests.  Part of the problem is I think
> that there methods don't mix well between blocking & non-blocking
> entities.  Something that is a natural fit for a blocking interface
> doesn't work at all in a non-blocking one, whereas something that's
> natural in a non-blocking interface is awkward and difficult to use in
> a blocking manner.
> 
> So, while I agree that it should be deprecated in name, I don't
> believe the functionality should be deprecated... if that makes any
> sense.
>
> Sam
> 

Fair enough. We can deprecate the method but we cannot add a new one
with a different name. So, this will have to wait until HttpCore 5.0. 

Actually HttpEntity#consumeContent(), ProducingNHttpentity#finish() and
ConsumingNHttpEntity#finish() should be just one method, whose purpose
is to release all resources currently held by the entity. #finish seems
like a reasonable name for it.

I'll add a comment to #consumeContent() that the name is a misnomer and
should be changed to #finish in the next major release.

Would that be OK?

Oleg


> On Sat, Apr 5, 2008 at 7:04 AM, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
> >
> > On Thu, 2008-04-03 at 20:12 +0200, Oleg Kalnichevski wrote:
> > > On Thu, 2008-04-03 at 13:00 -0400, Sam Berlin wrote:
> > > > > * As far as streaming entities are concerned #consumeContent is
> > > > > equivalent to a trivial code snippet
> > > > >
> > > > > InputStream instream = entity.getContent();
> > > > > if (instream != null) instream.close();
> > > >
> > > > Is that all consumeContent does?  I was under the impression that it
> > > > gobbled up the rest of the data (assuming there was unread data), and
> > > > left the connection in a state that it can be reused by subsequent
> > > > requests.
> > >
> > > Sam,
> > >
> > > The initial intent of this method was indeed to ensure the connection
> > > can be reused, but it just does not work with NIO entities introduced
> > > recently. Besides, for all existing blocking entities the implementation
> > > of this method merely closes the input stream and that is it.
> > >
> > > >  If all it does is close the inputstream (and by extension,
> > > > close the connection), then I'm +1 on the change.  If it instead read
> > > > the data & left the connection usable, I'm -1 on it.
> > > >
> > >
> > > But this is the responsibility of the underlying input stream #close()
> > > anyways. This is precisely the reason I do not see a lot of value in
> > > #consumeContent(). I also do not like the fact its name conflicts with
> > > that of the ConsumingNHttpEntity#consumeContent().
> > >
> > > Oleg
> > >
> >
> > Sam,
> >
> > Please let me know if you still object to this change. If not, I'll go
> > head and commit the changes. Otherwise, I'll leave things as they are.
> >
> >
> > Oleg
> >
> >
> >
> > >
> > > > Sam
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to