title: PublishSubject with Kotlin coroutines (Flow)
body: <p>I used a PublishSubject and I was sending messages to it and also I was listening for results. It worked flawlessly, but now I'm not sure how to do the same thing with Kotlin's coroutines (flows or channels).</p>
  
  <pre><code>private val subject = PublishProcessor.create&lt;Boolean&gt;&gt;()
  
  ...
  
  fun someMethod(b: Boolean) {
      subject.onNext(b)
  }
  
  fun observe() {
      subject.debounce(500, TimeUnit.MILLISECONDS)
             .subscribe { /* value received */ }
  }
  </code></pre>
  
  <p>Since I need the debounce operator I really wanted to do the same thing with flows so I created a channel and then I tried to create a flow from that channel and listen to changes, but I'm not getting any results.</p>
  
  <pre><code>private val channel = Channel&lt;Boolean&gt;()
  
  ...
  
  fun someMethod(b: Boolean) {
      channel.send(b)
  }
  
  fun observe() {
      flow {
           channel.consumeEach { value -&gt;
              emit(value)
           }
      }.debounce(500, TimeUnit.MILLISECONDS)
      .onEach {
          // value received
      }
  }
  </code></pre>
  
  <p>What is wrong?</p>