Search in sources :

Example 21 with ReplayProcessor

use of io.reactivex.rxjava3.processors.ReplayProcessor in project RxJava by ReactiveX.

the class ReplayProcessorTest method noHeadRetentionErrorTime.

@Test
public void noHeadRetentionErrorTime() {
    ReplayProcessor<Integer> source = ReplayProcessor.createWithTime(1, TimeUnit.MINUTES, Schedulers.computation());
    source.onNext(1);
    source.onNext(2);
    source.onError(new TestException());
    SizeAndTimeBoundReplayBuffer<Integer> buf = (SizeAndTimeBoundReplayBuffer<Integer>) source.buffer;
    assertNull(buf.head.value);
    Object o = buf.head;
    source.cleanupBuffer();
    assertSame(o, buf.head);
}
Also used : TestException(io.reactivex.rxjava3.exceptions.TestException)

Aggregations

TestException (io.reactivex.rxjava3.exceptions.TestException)16 Flowable (io.reactivex.rxjava3.core.Flowable)3 LongConsumer (io.reactivex.rxjava3.functions.LongConsumer)3 ReplayProcessor (io.reactivex.rxjava3.processors.ReplayProcessor)3 Action (io.reactivex.rxjava3.functions.Action)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)2 Test (org.junit.Test)2 Publisher (org.reactivestreams.Publisher)2 RFuture (org.redisson.api.RFuture)2 Single (io.reactivex.rxjava3.core.Single)1 Disposable (io.reactivex.rxjava3.disposables.Disposable)1 Consumer (io.reactivex.rxjava3.functions.Consumer)1 BooleanSubscription (io.reactivex.rxjava3.internal.subscriptions.BooleanSubscription)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 RedissonKeys (org.redisson.RedissonKeys)1 RTopic (org.redisson.api.RTopic)1 MessageListener (org.redisson.api.listener.MessageListener)1 RedisClient (org.redisson.client.RedisClient)1