src/main/java/io/reactivex/processors/ReplayProcessor.java
@CheckReturnValue
    @NonNull
    public static <T> ReplayProcessor<T> createWithTime(long maxAge, TimeUnit unit, Scheduler scheduler) {
        return new ReplayProcessor<T>(new SizeAndTimeBoundReplayBuffer<T>(Integer.MAX_VALUE, maxAge, unit, scheduler));
    }
@CheckReturnValue
    @NonNull
    public static <T> ReplayProcessor<T> createWithTime(long maxAge, TimeUnit unit, Scheduler scheduler) {
        return new ReplayProcessor<T>(new SizeAndTimeBoundReplayBuffer<T>(Integer.MAX_VALUE, maxAge, unit, scheduler));
    }
Creates a time-bounded ReplayProcessor.
<p>
In this setting, the {@code ReplayProcessor} internally tags each observed item with a timestamp value
supplied by the {@link Scheduler} and keeps only those whose age is less than the supplied time value
converted to milliseconds. For example, an item arrives at T=0 and the max age is set to 5; at T&gt;=5
this first item is then evicted by any subsequent item or termination event, leaving the buffer empty.
<p>
Once the processor is terminated, {@code Subscriber}s subscribing to it will receive items that remained in the
buffer after the terminal event, regardless of their age.
<p>
If a {@code Subscriber} subscribes while the {@code ReplayProcessor} is active, it will observe only those items
from within the buffer that have an age less than the specified time, and each item observed thereafter,
even if the buffer evicts items due to the time constraint in the mean time. In other words, once a
{@code Subscriber} subscribes, it observes items without gaps in the sequence except for any outdated items at the
beginning of the sequence.
<p>
Note that terminal notifications ({@code onError} and {@code onComplete}) trigger eviction as well. For
example, with a max age of 5, the first item is observed at T=0, then an {@code onComplete} notification
arrives at T=10. If a {@code Subscriber} subscribes at T=11, it will find an empty {@code ReplayProcessor} with just
an {@code onComplete} notification.

@param <T>
the type of items observed and emitted by this type of processor
@param maxAge
the maximum age of the contained items
@param unit
the time unit of {@code time}
@param scheduler
the {@link Scheduler} that provides the current time
@return the created processor