private void drainQueueIfActive()

in mobius-core/src/main/java/com/spotify/mobius/QueuingConnection.java [102:116]


    private void drainQueueIfActive() {
      final Connection<I> currentDelegate = delegate.get();

      // if the delegate is no longer the 'queueing delegate', then we're active and should forward
      // the queued messages. We could be 'disposed', but that's fine.
      if (currentDelegate != queuingDelegate) {
        while (true) {
          I value = queue.poll();
          if (value == null) {
            return;
          }
          currentDelegate.accept(value);
        }
      }
    }