So, what do you think about this pseudo-code to demonstrate the use of
ClientResource? (My experience has shown this to hang applications...)
function getText(url) {
var resource = new ClientResource(url)
var representation = resource.get()
if (representation) {
var text;
try {
text = representation.getText()
}
finally {
representation.exhaust()
}
return text
}
}
On Sun, Jan 2, 2011 at 3:29 PM, Jerome Louvel <[email protected]>wrote:
> After further investigation of the source code, I rediscovered the main
> intent behind the Representation#release() method which is to provide a
> callback from the connectors to the representation that can be called when
> it has been fully written out, therefore allowing the release of associated
> resources such as database connections.
>
> Representations provided by the connectors themselves apparently don't rely
> on this method to be called as long as the content is fully read or
> exhausted, but it shouldn't hurt to call it systematically.
>
> I've revised the wiki page again as well as the Representation#release()
> Javadocs to further clarify those points.
>
> Best regards,
> Jerome
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2695526
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2695534