title: RXjava code conversion from 1.0 to 2.0 - subscriber.isUnsubscribed() not available
body: <p>I am following book which uses <code>subscriber.isUnsubscribed()</code> but it is no longer available in version 2.0. Can somebody guide me how to rewrite this code to be able to use <code>isUnsubscribed</code> check in the Observable lambda?</p>
  
  <pre><code>Observable&lt;BigInteger&gt; naturalNumbers = Observable.create(
      subscriber -&gt; {
          Runnable r = () -&gt; {
              BigInteger i = ZERO;
              while (!subscriber.isUnsubscribed()) {
                  subscriber.onNext(i);
                  i = i.add(ONE);
              }
          };
          new Thread(r).start();
      });
  
  
  Subscription subscription = naturalNumbers.subscribe(x -&gt; log(x));
  //after some time...
  subscription.unsubscribe();
  </code></pre>