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

io.lettuce.core.dynamic.AsyncExecutableCommandLookupStrategy 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.dynamic;

import java.util.List;

import io.lettuce.core.api.StatefulConnection;
import io.lettuce.core.codec.RedisCodec;
import io.lettuce.core.dynamic.output.CommandOutputFactoryResolver;
import io.lettuce.core.internal.LettuceAssert;

/**
 * @author Mark Paluch
 * @since 5.0
 */
class AsyncExecutableCommandLookupStrategy extends ExecutableCommandLookupStrategySupport {

    private final StatefulConnection connection;

    public AsyncExecutableCommandLookupStrategy(List> redisCodecs,
            CommandOutputFactoryResolver commandOutputFactoryResolver, CommandMethodVerifier commandMethodVerifier,
            StatefulConnection connection) {

        super(redisCodecs, commandOutputFactoryResolver, commandMethodVerifier);
        this.connection = connection;
    }

    @Override
    public ExecutableCommand resolveCommandMethod(CommandMethod method, RedisCommandsMetadata metadata) {

        LettuceAssert.isTrue(!method.isReactiveExecution(),
                () -> String.format("Command method %s not supported by this command lookup strategy", method));

        CommandFactory commandFactory = super.resolveCommandFactory(method, metadata);

        return new AsyncExecutableCommand(method, commandFactory, connection);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy