title: Kotlin EventBus triggered twice
body: <p>I use this code for eventBus in kotlin, but it triggers twice. I don't know why this happens</p>
  
  <pre><code>object EventBus {
      val bus: BroadcastChannel&lt;Any&gt; = BroadcastChannel&lt;Any&gt;(1)
  
      private val parentJob = Job()
      private val coroutineContext: CoroutineContext
          get() = parentJob + Dispatchers.Default
  
      private val scope = CoroutineScope(coroutineContext)
      fun send(o: Any) {
          scope.launch {
              bus.send(o)
          }
      }
  
      inline fun &lt;reified T&gt; asChannel(): ReceiveChannel&lt;T&gt; {
          return bus.openSubscription().filter { it is T }.map { it as T }
      }
  }
  </code></pre>
  
  <p>and use it in this way</p>
  
  <pre><code>EventBus.send(NetEvent(false))
  </code></pre>
  
  <p>and listen t it as below (this code runs twice)</p>
  
  <pre><code> var subscription = EventBus.asChannel&lt;NetEvent&gt;()
      var s = scope.launch {
          subscription.consumeEach { event -&gt;
  
              Timber.i("NetEvent ${event.isConected}")
              currentNet = event.isConected
          }
      }
  </code></pre>