public <T> void onNext(AbstractListenerWriteProcessor<T> processor, T data) { processor.discardData(data); processor.cancel(); processor.onError(new IllegalStateException("Illegal onNext without demand")); }
/** * Template method invoked after a data item to write is received via * {@link Subscriber#onNext(Object)}. The default implementation saves the * data item for writing once that is possible. */ protected void dataReceived(T data) { T prev = this.currentData; if (prev != null) { // This shouldn't happen: // 1. dataReceived can only be called from REQUESTED state // 2. currentData is cleared before requesting discardData(data); cancel(); onError(new IllegalStateException("Received new data while current not processed yet.")); } this.currentData = data; }
public <T> void onNext(AbstractListenerWriteProcessor<T> processor, T data) { processor.discardData(data); processor.cancel(); processor.onError(new IllegalStateException("Illegal onNext without demand")); }
/** * Template method invoked after a data item to write is received via * {@link Subscriber#onNext(Object)}. The default implementation saves the * data item for writing once that is possible. */ protected void dataReceived(T data) { T prev = this.currentData; if (prev != null) { // This shouldn't happen: // 1. dataReceived can only be called from REQUESTED state // 2. currentData is cleared before requesting discardData(data); cancel(); onError(new IllegalStateException("Received new data while current not processed yet.")); } this.currentData = data; }
public <T> void onNext(AbstractListenerWriteProcessor<T> processor, T data) { processor.discardData(data); processor.cancel(); processor.onError(new IllegalStateException("Illegal onNext without demand")); }
/** * Template method invoked after a data item to write is received via * {@link Subscriber#onNext(Object)}. The default implementation saves the * data item for writing once that is possible. */ protected void dataReceived(T data) { T prev = this.currentData; if (prev != null) { // This shouldn't happen: // 1. dataReceived can only be called from REQUESTED state // 2. currentData is cleared before requesting discardData(data); cancel(); onError(new IllegalStateException("Received new data while current not processed yet.")); } this.currentData = data; }