背压和溢出

Streams.just(1,2,3,4,5)
  .buffer(3) //1
  //onOverflowBuffer()
  .capacity(2) //2
  .consume()


Streams.just(1,2,3,4,5)
  .dispatchOn(dispatcher1) //3
  //onOverflowBuffer()
  .dispatchOn(dispatcher2) //4
  .consume()
Streams.range(1,1000000)
  .subscribe(new DefaultSubscriber<Long>(){ 
    Subscription sub;

    @Override
    void onSubscribe(Subscription sub){
      this.sub = sub;
      sub.request(1); 
    }

    @Override
    void onNext(Long n){
      httpClient.get("localhost/"+n).onSuccess(rep -> sub.request(1)); 
    }
  );
Stream<T> API 作用