All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lettuce.core.cluster.ReactiveExecutionsImpl Maven / Gradle / Ivy

Go to download

Advanced and thread-safe Java Redis client for synchronous, asynchronous, and reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs and much more.

The newest version!
package io.lettuce.core.cluster;

import java.util.Collection;
import java.util.Map;
import java.util.concurrent.CompletionStage;

import org.reactivestreams.Publisher;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import io.lettuce.core.cluster.api.reactive.ReactiveExecutions;
import io.lettuce.core.cluster.models.partitions.RedisClusterNode;

/**
 * Default implementation of {@link ReactiveExecutions}.
 *
 * @author Mark Paluch
 * @since 4.4
 */
class ReactiveExecutionsImpl implements ReactiveExecutions {

    private Map>> executions;

    public ReactiveExecutionsImpl(Map>> executions) {
        this.executions = executions;
    }

    @Override
    @SuppressWarnings("unchecked")
    public Flux flux() {
        return Flux.fromIterable(executions.values()).flatMap(Mono::fromCompletionStage).flatMap(f -> f);
    }

    @Override
    public Collection nodes() {
        return executions.keySet();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy