commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [javaflow] How to compare two continuations?
Date Wed, 18 Apr 2012 00:47:57 GMT
On 18 April 2012 01:04, Safwan Khan <personal.cache@gmail.com> wrote:
> I’m a very newbie in javaflow.

Such questions belong on the Commons User list, not the developer list.
Please subscribe to it and ask there.

> 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);
> Continuation e = Continuation.continueWith(d);
> Continuation f = Continuation.continueWith(d);
> if (e.equals(f)) System.out.println("They are equal!");
> else System.out.println("They are not equal!");
>
>
> Both continuation e and f starts with same check point (d) and captures the
> same stacks and also both of them print 1. Then still why “They are not
> equal!”? (program gives this output). Can someone please explain it to me?
>
> Thanks,
> Sainan

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


Mime
View raw message