public final void subscribe ( IxConsumer < ? super T > onNext , IxConsumer < Throwable > onError , Runnable onCompleted ) { try { for ( T v : this ) { onNext . accept ( v ) ; } } catch ( Throwable ex ) { onError . accept ( ex ) ; return ; } onCompleted . run ( ) ; }
Iterates over this sequence and calls the given onNext action with each element and calls the onError with any exception thrown by the iteration or the onNext action ; otherwise calls the onCompleted action when the sequence completes without exception .