/** * Create a new {@link ReplayProcessor} that either replay all the elements or a * limited amount of elements depending on the {@code unbounded} parameter. * * @param historySize maximum items retained if bounded, or initial link size if unbounded * @param unbounded true if "unlimited" data store must be supplied * @param <E> the type of the pushed elements * * @return a new {@link ReplayProcessor} that replays the whole history to each new * {@link Subscriber} if configured as unbounded, a limited history otherwise. */ public static <E> ReplayProcessor<E> create(int historySize, boolean unbounded) { FluxReplay.ReplayBuffer<E> buffer; if (unbounded) { buffer = new FluxReplay.UnboundedReplayBuffer<>(historySize); } else { buffer = new FluxReplay.SizeBoundReplayBuffer<>(historySize); } return new ReplayProcessor<>(buffer); }
throw new IllegalArgumentException("size > 0 required but it was " + size); return new ReplayProcessor<>(new FluxReplay.SizeAndTimeBoundReplayBuffer<>(size, maxAge.toMillis(), scheduler));
/** * Create a new {@link ReplayProcessor} that either replay all the elements or a * limited amount of elements depending on the {@code unbounded} parameter. * * @param historySize maximum items retained if bounded, or initial link size if unbounded * @param unbounded true if "unlimited" data store must be supplied * @param <E> the type of the pushed elements * * @return a new {@link ReplayProcessor} that replays the whole history to each new * {@link Subscriber} if configured as unbounded, a limited history otherwise. */ public static <E> ReplayProcessor<E> create(int historySize, boolean unbounded) { FluxReplay.ReplayBuffer<E> buffer; if (unbounded) { buffer = new FluxReplay.UnboundedReplayBuffer<>(historySize); } else { buffer = new FluxReplay.SizeBoundReplayBuffer<>(historySize); } return new ReplayProcessor<>(buffer); }
throw new IllegalArgumentException("size > 0 required but it was " + size); return new ReplayProcessor<>(new FluxReplay.SizeAndTimeBoundReplayBuffer<>(size, maxAge.toMillis(), scheduler));