public void Take() { Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3)) .Take(4) .Test() .AssertResult(1, 2, 3, 4); }
public void Rebatch() { Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3)) .RebatchRequests(1) .Test() .AssertResult(1, 2, 3, 4, 5, 6); }
public void NormalConditional() { Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3)) .Filter(v => true) .Test() .AssertResult(1, 2, 3, 4, 5, 6); }
public void Cancel() { var dp = new DirectProcessor <int>(); var ts = Flowable.Concat(dp).Test(); Assert.IsTrue(dp.HasSubscribers); ts.Cancel(); Assert.IsFalse(dp.HasSubscribers); }
public void Backpressure() { Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3)) .Test(0) .AssertValues() .RequestMore(1) .AssertValues(1) .RequestMore(3) .AssertValues(1, 2, 3, 4) .RequestMore(2) .AssertResult(1, 2, 3, 4, 5, 6); }
public void Normal() { Flowable.Concat(Flowable.Range(1, 3), Flowable.Range(4, 3)) .Test() .AssertResult(1, 2, 3, 4, 5, 6); }
public override IPublisher <int> CreatePublisher(long elements) { long half = elements / 2; return(Flowable.Concat(Flowable.Range(0, (int)half), Flowable.Range((int)half, (int)(elements - half))).Filter(v => true)); }