// Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
// 
//     /**
//      * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
//      * 
//      * @return the synchronous API for the underlying connection.
//      */
//     DisqueCommands<K, V> sync();
// 
//     /**
//      * Returns the {@link DisqueAsyncCommands} API for the current connection. Does not create a new connection.
//      * 
//      * @return the asynchronous API for the underlying connection.
//      */
//     DisqueAsyncCommands<K, V> async();
// 
//     /**
//      * Returns the {@link DisqueReactiveCommands} API for the current connection. Does not create a new connection.
//      *
//      * @return the reactive API for the underlying connection.
//      */
//     DisqueReactiveCommands<K, V> reactive();
// 
// }


import com.lambdaworks.redis.resource.ClientResources;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.impl.*;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import com.lambdaworks.redis.*;
import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.codec.Utf8StringCodec;
import com.lambdaworks.redis.internal.LettuceAssert;
import com.lambdaworks.redis.protocol.CommandHandler;
import com.lambdaworks.redis.protocol.RedisCommand;
     * @return a new instance of {@link DisqueClient}
     */
    public static DisqueClient create(ClientResources clientResources, String uri) {
        assertNotNull(clientResources);
        LettuceAssert.notNull(uri, "uri must not be null");
        return create(clientResources, DisqueURI.create(uri));
    }

    /**
     * Create a new client that connects to the supplied {@link RedisURI uri} with shared {@link ClientResources}. You need to
     * shut down the {@link ClientResources} upon shutting down your application.You can connect to different Redis servers but
     * you must supply a {@link RedisURI} on connecting.
     * 
     * @param clientResources the client resources, must not be {@literal null}
     * @param disqueURI the Redis URI, must not be {@literal null}
     * @return a new instance of {@link DisqueClient}
     */
    public static DisqueClient create(ClientResources clientResources, DisqueURI disqueURI) {
        assertNotNull(clientResources);
        assertNotNull(disqueURI);
        return new DisqueClient(clientResources, disqueURI);
    }

    /**
     * Open a new connection to a Disque server that treats keys and values as UTF-8 strings. This method requires to have the
     * {@link DisqueURI} specified when constructing the client. Command timeouts are applied from the default
     * {@link #setDefaultTimeout(long, TimeUnit)} settings.
     *
     * @return A new connection.
     */
// Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
// 
//     /**
//      * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
//      * 
//      * @return the synchronous API for the underlying connection.
//      */
//     DisqueCommands<K, V> sync();
// 
//     /**
//      * Returns the {@link DisqueAsyncCommands} API for the current connection. Does not create a new connection.
//      * 
//      * @return the asynchronous API for the underlying connection.
//      */
//     DisqueAsyncCommands<K, V> async();
// 
//     /**
//      * Returns the {@link DisqueReactiveCommands} API for the current connection. Does not create a new connection.
//      *
//      * @return the reactive API for the underlying connection.
//      */
//     DisqueReactiveCommands<K, V> reactive();
// 
// }


// Path: src/main/java/biz/paluch/spinach/DisqueClient.java
import com.lambdaworks.redis.resource.ClientResources;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.impl.*;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import com.lambdaworks.redis.*;
import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.codec.Utf8StringCodec;
import com.lambdaworks.redis.internal.LettuceAssert;
import com.lambdaworks.redis.protocol.CommandHandler;
import com.lambdaworks.redis.protocol.RedisCommand;

     * @return a new instance of {@link DisqueClient}
     */
    public static DisqueClient create(ClientResources clientResources, String uri) {
        assertNotNull(clientResources);
        LettuceAssert.notNull(uri, "uri must not be null");
        return create(clientResources, DisqueURI.create(uri));
    }

    /**
     * Create a new client that connects to the supplied {@link RedisURI uri} with shared {@link ClientResources}. You need to
     * shut down the {@link ClientResources} upon shutting down your application.You can connect to different Redis servers but
     * you must supply a {@link RedisURI} on connecting.
     * 
     * @param clientResources the client resources, must not be {@literal null}
     * @param disqueURI the Redis URI, must not be {@literal null}
     * @return a new instance of {@link DisqueClient}
     */
    public static DisqueClient create(ClientResources clientResources, DisqueURI disqueURI) {
        assertNotNull(clientResources);
        assertNotNull(disqueURI);
        return new DisqueClient(clientResources, disqueURI);
    }

    /**
     * Open a new connection to a Disque server that treats keys and values as UTF-8 strings. This method requires to have the
     * {@link DisqueURI} specified when constructing the client. Command timeouts are applied from the default
     * {@link #setDefaultTimeout(long, TimeUnit)} settings.
     *
     * @return A new connection.
     */
    public DisqueConnection<String, String> connect() {