Define a continuation on the global level, and then invoke it:

var __terminateInterpreter__ = new Continuation();

function captureAndSuspend() {
    globals.x = new Continuation();
    __terminateInterpreter__();
}

Attila.

--
home: http://www.szegedi.org
twitter: http://twitter.com/szegedi
weblog: http://constc.blogspot.com

On 2008.12.11., at 16:54, [EMAIL PROTECTED] wrote:

Hi,

Trying to get something working using continuations. I have the
following setup:
function capture() {
  globals.x = new Continuation()
}

function test() {
 //some code
 capture()
 //some code part 2
}

What I want to achieve is after capturing the continuation using
"capture()" in function test, I want to suspend the execution of
function test, untill I call globals.x() at some point.

This "point" can be a lot of time later in the program.

I haven't been able to find any way to do this, except throwing an
error and at high level in my program capture such errors and do
nothing with them.

Am I missing something?

I looked for docs/samplecode, but the only thing I found that was
remotely usefull was http://wiki.apache.org/cocoon/RhinoWithContinuations ,
but it didn't answer this question.

Tnx in advance,

K.





_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to