You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Safwan Khan <pe...@gmail.com> on 2012/04/18 01:53:45 UTC

How to store and use a continuation for later use

I’m a very newbie in javaflow. Consider the following basic example:
class MyRunnable implements Runnable {
  public void run() {
    System.out.println("started!");
    for( int i=0; i<10; i++ )
      echo(i);
  }
  private void echo(int x) {
    System.out.println(x);
    Continuation.suspend();
  }
}

Continuation c = Continuation.startWith(new MyRunnable());
Continuation d = Continuation.continueWith(c);

I can do it from the same program. But how can I do it like saving “c” from
this program and later restore it from another program? Can you please give
me an example with the appropriate syntax for that part only?

Thanks,
Sainan

Re: How to store and use a continuation for later use

Posted by sebb <se...@gmail.com>.
Such questions belong on the Commons User list, not the developer list.
Please subscribe to it and ask there.



On 18 April 2012 00:53, Safwan Khan <pe...@gmail.com> wrote:
> I’m a very newbie in javaflow. Consider the following basic example:
> class MyRunnable implements Runnable {
>  public void run() {
>    System.out.println("started!");
>    for( int i=0; i<10; i++ )
>      echo(i);
>  }
>  private void echo(int x) {
>    System.out.println(x);
>    Continuation.suspend();
>  }
> }
>
> Continuation c = Continuation.startWith(new MyRunnable());
> Continuation d = Continuation.continueWith(c);
>
> I can do it from the same program. But how can I do it like saving “c” from
> this program and later restore it from another program? Can you please give
> me an example with the appropriate syntax for that part only?
>
> Thanks,
> Sainan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org