class SentinelTopologyRefreshConnections extends
        CompletableEventLatchSupport<StatefulRedisPubSubConnection<String, String>, SentinelTopologyRefreshConnections> {

    private final List<Throwable> exceptions = new CopyOnWriteArrayList<>();

    private final AtomicInteger success = new AtomicInteger();

    /**
     * Construct a new {@link CompletableEventLatchSupport} class expecting {@code expectedCount} notifications.
     *
     * @param expectedCount
     */
    public SentinelTopologyRefreshConnections(int expectedCount) {
        super(expectedCount);
    }

    @Override
    protected void onAccept(StatefulRedisPubSubConnection<String, String> value) {
        success.incrementAndGet();
    }

    @Override
    protected void onError(Throwable value) {
        exceptions.add(value);
    }

    @Override
    protected void onEmit(Emission<SentinelTopologyRefreshConnections> emission) {<FILL_FUNCTION_BODY>}

}


        if (success.get() == 0) {

            RedisException exception = new RedisException("Cannot attach to Redis Sentinel for topology refresh");
            exceptions.forEach(exception::addSuppressed);
            emission.error(exception);
        } else {
            emission.success(this);
        }
    
<methods>public void <init>(int) ,public final void accept(StatefulRedisPubSubConnection<java.lang.String,java.lang.String>) ,public final void accept(java.lang.Throwable) ,public final int getExpectedCount() ,public final CompletionStage<io.lettuce.core.masterreplica.SentinelTopologyRefreshConnections> getOrTimeout(java.time.Duration, java.util.concurrent.ScheduledExecutorService) <variables>private static final int GATE_CLOSED,private static final int GATE_OPEN,private static final AtomicIntegerFieldUpdater<CompletableEventLatchSupport#RAW> GATE_UPDATER,private static final AtomicIntegerFieldUpdater<CompletableEventLatchSupport#RAW> NOTIFICATIONS_UPDATER,private final non-sealed int expectedCount,private volatile int gate,private volatile int notifications,private final CompletableFuture<io.lettuce.core.masterreplica.SentinelTopologyRefreshConnections> selfFuture,private volatile ScheduledFuture<?> timeoutScheduleFuture