title: rxjava - Publish Processor race condition
body: <p>Hi I'm new to RxJava and the whole reactive programming idea, And I would like some help understanding a few concepts.</p>
  
  <p>Here is the thing, I have this class that dispatches messages, this class has an Inner PublishProcessor, which is what I thought was the best solution to being able to publish messages dynamically, since it seems that Observable/Flowable are born from alredy existant or received data, say, I could not handle the push of a button N times.</p>
  
  <p>So this class has this dispatch(SomeClass c) that calls the OnNext method of my publisher, effectively sending data to every subscriber at the time.
  But say a Network request finishes at the exact same time a button is pushed, both messages collide and none get effectively sent, and the docs say this is expected behavior.</p>
  
  <p>How would you handle this situation? this is basically it.</p>
  
  <pre><code>private ObservableList&lt;ObservableResponse&gt; list;
  
  public static class ObservableList&lt;T&gt; {
  
      protected final PublishProcessor&lt;T&gt; onAdd;
  
      public ObservableList() {
          this.onAdd = PublishProcessor.create();
      }
  
      public void add(T value) {
          onAdd.onNext(value);
      }
  
      public io.reactivex.Observable&lt;T&gt; getObservable() {
          return onAdd.toObservable();
      }
  
      public PublishProcessor&lt;T&gt; getProcessor(){
          return onAdd;
      }
  
  }
  
  private MessageStream(){
      this.list = new ObservableList&lt;&gt;();
  }
  
  public static class helper{
      public static MessageStream instance = new MessageStream();
  }
  
  public void dispatchMessage(ObservableResponse x ){
      this.list.add(x);
  }
  </code></pre>
  
  <p>Observable response is a POJO in itself.</p>
  
  <p>Any help would be appreciated, I know the docs are strong, yet there is a lot more about rx1 than rx2, so I got confused real hard... </p>