title: How to combine TaskCompletionSource and CancellationTokenSource?
body: <p>I have such code (simplified here) which awaits finishing task:</p>
  
  <pre><code>var task_completion_source = new TaskCompletionSource&lt;bool&gt;();
  observable.Subscribe(b =&gt; 
     { 
        if (b) 
            task_completion_source.SetResult(true); 
     });
  await task_completion_source.Task;    
  </code></pre>
  
  <p>The idea is to subscribe and wait for the <code>true</code> in the stream of booleans. This finishes the "task" and I can move on beyond the <code>await</code>.</p>
  
  <p>However I would like to cancel -- but not subscription, but awaiting. I would like to pass cancel token (somehow) to <code>task_completion_source</code> so when I cancel the token source, the <code>await</code> will move on.</p>
  
  <p>How to do it?</p>
  
  <p><strong>Update</strong>: <code>CancellationTokenSource</code> is external to this code, all I have here is the token from it.</p>