Пример #1
0
 void drain(List<Object> localQueue) {
   if (localQueue == null) {
     return;
   }
   for (Object o : localQueue) {
     if (nl.isCompleted(o)) {
       serializedChild.onCompleted();
       break;
     } else if (nl.isError(o)) {
       serializedChild.onError(nl.getError(o));
       break;
     } else {
       @SuppressWarnings("unchecked")
       T t = (T) o;
       serializedChild.onNext(t);
       arbiter.produced(1);
     }
   }
 }
Пример #2
0
    void error(Throwable e, int id) {
      List<Object> localQueue;
      synchronized (guard) {
        if (id != index) {
          return;
        }
        if (emitting) {
          if (queue == null) {
            queue = new ArrayList<Object>();
          }
          queue.add(nl.error(e));
          return;
        }

        localQueue = queue;
        queue = null;
        emitting = true;
      }

      drain(localQueue);
      serializedChild.onError(e);
      unsubscribe();
    }
Пример #3
0
 @Override
 public void onError(Throwable e) {
   serializedChild.onError(e);
   unsubscribe();
 }