You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ben hathaway <be...@spidersat.net> on 2005/06/28 10:11:52 UTC

jsFlow continuation disposal catching

Dear all,

 

Scenario: A user wants to be able to do some tidying up at the point that a
particular continuation times out and is destroyed. In my case, I want to
send a notification e-mail that the particular process has timed out before
being completed.

 

Solution: I've noticed that there is a mechanism for calling some code when
a WebContinuation gets destroyed (the Disposer class). However, it doesn't
seem to be used for Flowscripts. I've traced the code through and It looks
like it should be easy to modify the continuation construction mechanism to
include a Disposer, which could then call a Javascript function. Ideally, it
should hunt out any /finally/ clauses in the current scope and call them,
but that might prove a bit difficult.

 

Problem: This is my first sortie into the Cocoon code and my other projects
are on a very tight deadline. Should I go ahead and make this change as best
I can or work around for now? Is anyone else working on a similar (probably
better) solution? Does the Apples API allow me to do this in a more simple
way?

 

I'd welcome your comments, hints and advice.

 

Regards,

 

Ben Hathaway.


Re: jsFlow continuation disposal catching

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tuesday 28 June 2005 16:11, Ben hathaway wrote:
>  Ideally, it should hunt out any /finally/ clauses in the current scope and
> call them, but that might prove a bit difficult.

Reestablish the contiuation context, and then throw an exception should not be 
too hard to implement, and would allow for catching the disposal and 
executing a the finally clauses.


Cheers
Niclas