@Override public void onError(final Throwable t) { Objects.requireNonNull(t); val cons = getAction().getError(); // if(cons!=null) cons.accept(t); }
@Override public void onComplete() { val run = getAction().getOnComplete(); // if(run!=null) run.run(); } public boolean isInitialized() {
@Override public void onNext(final T t) { val cons = getAction().getAction(); //if (cons != null) cons.accept(t); }
public ReactiveSeq<T> registerAndstream(Runnable r){ streamCreated = true; return Spouts.asyncStream(getAction(r)); }
public boolean isInitialized() { return getAction().isInitialized(); }
/** * <pre> * {@code * PushSubscriber<Integer> sub = Spouts.asyncSubscriber(); * * //on a seperate thread * for(int i=0;i<100;i++) sub.onNext(i); sub.onComplete(); * * //on the main thread * * sub.stream() * .peek(System.out::println) * .collect(CyclopsCollectors.toList()); * * //note JDK Stream based terminal operations may block the current thread * //see ReactiveSeq#collectStream ReactiveSeq#foldAll for non-blocking alternatives * } * </pre> * * @return A push-based asychronous event driven Observable-style Stream that avoids the overhead of backpressure support **/ public ReactiveSeq<T> stream(){ streamCreated = true; return Spouts.asyncStream(getAction(()->{})); } public ReactiveSeq<T> registerAndstream(Runnable r){
@Override public void onNext(final T t) { val cons = getAction().getAction(); //if (cons != null) cons.accept(t); }
public ReactiveSeq<T> registerAndstream(Runnable r){ streamCreated = true; return Spouts.asyncStream(getAction(r)); }
@Override public void onError(final Throwable t) { Objects.requireNonNull(t); val cons = getAction().getError(); // if(cons!=null) cons.accept(t); }
@Override public void onComplete() { val run = getAction().getOnComplete(); // if(run!=null) run.run(); } public boolean isInitialized() {
public boolean isInitialized() { return getAction().isInitialized(); }
/** * <pre> * {@code * PushSubscriber<Integer> sub = Spouts.asyncSubscriber(); * * //on a seperate thread * for(int i=0;i<100;i++) sub.onNext(i); sub.onComplete(); * * //on the main thread * * sub.stream() * .peek(System.out::println) * .collect(CyclopsCollectors.toList()); * * //note JDK Stream based terminal operations may block the current thread * //see ReactiveSeq#collectStream ReactiveSeq#foldAll for non-blocking alternatives * } * </pre> * * @return A push-based asychronous event driven Observable-style Stream that avoids the overhead of backpressure support **/ public ReactiveSeq<T> stream(){ streamCreated = true; return Spouts.asyncStream(getAction(()->{})); } public ReactiveSeq<T> registerAndstream(Runnable r){