commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: [javaflow] How to store and use a continuation for later use
Date Tue, 01 May 2012 13:58:54 GMT
Check the testcases. They should also test serialization of continuations.

cheers,
Torsten

On Wed, Apr 18, 2012 at 4:21 AM, Sainan Khan <personal.cache@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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message