title: How to use CancelableOperation to cancel future chaining
body: <p>I'm not able to understand how dart async CancelableOperation.fromFuture works. It seems to cancel the first future but the .then is always executed. </p>
  
  <p>While working with sockets I need to cancel a connection operation to avoid waiting for the socket timeout. </p>
  
  <pre class="lang-dart prettyprint-override"><code>final op = f1
          .then((_) =&gt; f2);
  
      _connectOperation = CancelableOperation.fromFuture(op,
          onCancel: () =&gt; throw CustomException());
  
      return _connectOperation.valueOrCancellation();
  </code></pre>
  
  <p>f1 gets cancelled but f2 is still executed.</p>