title: Cancel a task in reactivex.net
body: <p>Assumed that I have existed code like:</p>
  
  <pre><code>public IEnumerable&lt;DataType&gt; GetAllData(string[] ids) {
      foreach(var id in ids) {
          //this is a time-consuming operation, like query from database
          var data = this.repo.Find(id);
          yield return data;
      }
  }
  </code></pre>
  
  <p>I tried to apply Rx to the front-end code:</p>
  
  <pre><code>var observable = GetAllData(new[] { "1", "2", "3" }).ToObservable();
  var subs = observable
      .SubscribeOn(Scheduler.Default)
      .Subscribe(
          data =&gt; Console.WriteLine(data.Id), 
          () =&gt; Console.WriteLine("All Data Fetched Completed"));
  </code></pre>
  
  <p>And it's working properly.</p>
  
  <p>But once I bind a subscription to the <code>IObservable</code>, is there any way I can stop it continue fetching data half-way? Dispose the subscription won't stop the enumeration.</p>