title: Kotlin Flow onBackpressureDrop RxJava2 analog
body: <p>In RxJava 2 Flowable there are different backpressure strategies, among them the most interesting are:</p>
  
  <ul>
  <li>LATEST</li>
  <li>BUFFER</li>
  <li>DROP</li>
  </ul>
  
  <p>which are respected throughout whole Rx chain.</p>
  
  <p>In Kotlin there is Flow, which declares that it has backpressure support out-of-the-box.
  I was able to make Flow to have BUFFER and LATEST strategies by using the following:</p>
  
  <p>For BUFFER:</p>
  
  <pre><code>observeFlow()
      .buffer(10)
      .collect { ... }
  </code></pre>
  
  <p>With LATEST:</p>
  
  <pre><code>observeFlow()
      .conflate()
      .collect { ... }
  </code></pre>
  
  <p>Which is just shortcut on that same buffer operator.</p>
  
  <p>But I was not able to find anything that can work same as DROP.
  In short DROP will drop any value which comes in the stream when previous value hasn't been processed yet.
  And with Flow I even not sure that it is possible at all.</p>
  
  <p>Considering the case:</p>
  
  <pre><code>observeFlow()
      .backpressureDrop() // non-existent operator, just for illustrative purposes
      .map { ... }
      .flatMapMerge { ... }
      .collect { ... }
  </code></pre>
  
  <p>So backpressureDrop should respect any work which is done below in the stream, while that operator don't know anything about what is happening below (without explicit callback from the bottom - like "request" method in RxJava Subscriber). Therefore it seems not that possible. And that operator should not pass through any event before previous item was collected.</p>
  
  <p>Is there any ready operator, which I miss, or is there a straightforward way to implement something like this with existing API?</p>