cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: flow: release resources after the view is generated
Date Sun, 13 Jun 2004 21:28:10 GMT
Vadim Gritsenko wrote:

> What worries me is that sendPageAndWait provides an argument, which is 
> reference to the cleanup function. AFAIU, this function should be 
> invoked after page is sent. If you take a look at sendPageAndWait, it 
> looks like:
>
> FOM_Cocoon.prototype.sendPageAndWait = function(uri, bizData, fun, ttl) {
>    this.sendPage(uri, bizData,
>                  new FOM_WebContinuation(new Continuation(),
>                                          this.continuation, ttl));
>    if (fun) {
>        if (!(fun instanceof Function)) {
>            throw "Expected a function instead of: " + fun;
>        }
>        fun();
>    }
>    FOM_Cocoon.suicide();
> }
>
> So if you provide a function which closes connection, performs other 
> cleanup actions, it should be invoked when view is generated. And this 
> means, that sendPage returns execution control only when view is 
> rendered already. Now, why this does not work or what I'm missing here?


It may not work if the flowscript is called within an internal pipeline, 
since in that case sendPage() only builds the pipeline, but doesn't 
execute it.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message