// Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
//         DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
// 
//     /**
//      * Authenticate to the server.
//      *
//      * @param password the password
//      * @return String simple-string-reply
//      */
//     RedisFuture<String> auth(String password);
// 
//     /**
//      * Close the connection. The connection will become not usable anymore as soon as this method was called.
//      */
//     void close();
// 
//     /**
//      *
//      * @return the underlying connection.
//      */
//     DisqueConnection<K, V> getConnection();
// 
//     /**
//      * 
//      * @return true if the connection is open (connected and not closed).
//      */
//     boolean isOpen();
// 
//     /**
//      * Ping the server.
//      *
//      * @return simple-string-reply
//      */
//     RedisFuture<String> ping();
// 
//     /**
//      * Close the connection.
//      * 
//      * @return String simple-string-reply always OK.
//      */
//     RedisFuture<String> quit();
// 
// }
// 
// Path: src/main/java/biz/paluch/spinach/api/rx/DisqueReactiveCommands.java
// public interface DisqueReactiveCommands<K, V> extends DisqueJobReactiveCommands<K, V>, DisqueQueueReactiveCommands<K, V>,
//         DisqueServerReactiveCommands<K, V>, DisqueClusterReactiveCommands<K, V> {
// 
//     /**
//      * Authenticate to the server.
//      *
//      * @param password the password
//      * @return String simple-string-reply
//      */
//     Observable<String> auth(String password);
// 
//     /**
//      * Close the connection. The connection will become not usable anymore as soon as this method was called.
//      */
//     void close();
// 
//     /**
//      *
//      * @return the underlying connection.
//      */
//     DisqueConnection<K, V> getConnection();
// 
//     /**
//      * 
//      * @return true if the connection is open (connected and not closed).
//      */
//     boolean isOpen();
// 
//     /**
//      * Ping the server.
//      *
//      * @return simple-string-reply
//      */
//     Observable<String> ping();
// 
//     /**
//      * Close the connection.
//      * 
//      * @return String simple-string-reply always OK.
//      */
//     Observable<String> quit();
// 
// }
// 
// Path: src/main/java/biz/paluch/spinach/api/sync/DisqueCommands.java
// public interface DisqueCommands<K, V> extends DisqueJobCommands<K, V>, DisqueQueueCommands<K, V>, DisqueServerCommands<K, V>,
//         DisqueClusterCommands<K, V> {
// 
//     /**
//      * Authenticate to the server.
//      *
//      * @param password the password
//      * @return String simple-string-reply
//      */
//     String auth(String password);
// 
//     /**
//      * Close the connection. The connection will become not usable anymore as soon as this method was called.
//      */
//     void close();
// 
//     /**
//      *
//      * @return the underlying connection.
//      */
//     DisqueConnection<K, V> getConnection();
// 
//     /**
//      *
//      * @return true if the connection is open (connected and not closed).
//      */
//     boolean isOpen();
// 
//     /**
//      * Ping the server.
//      *
//      * @return simple-string-reply
//      */
//     String ping();
// 
//     /**
//      * Close the connection.
//      * 
//      * @return String simple-string-reply always OK.
//      */
//     String quit();
// 
//     /**
//      * Set the default timeout for operations.
//      *
//      * @param timeout the timeout value
//      * @param unit the unit of the timeout value
//      */
//     void setTimeout(long timeout, TimeUnit unit);
// }


import biz.paluch.spinach.api.async.DisqueAsyncCommands;
import biz.paluch.spinach.api.rx.DisqueReactiveCommands;
import biz.paluch.spinach.api.sync.DisqueCommands;
import com.lambdaworks.redis.api.StatefulConnection;
/*
 * Copyright 2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package biz.paluch.spinach.api;



/**
 * A thread-safe connection to a redis server. Multiple threads may share one {@link DisqueConnection}.
 * 
 * A {@link com.lambdaworks.redis.protocol.ConnectionWatchdog} monitors each connection and reconnects automatically until
 * {@link #close} is called. All pending commands will be (re)sent after successful reconnection.
 * 
 * @param <K> Key type.
 * @param <V> Value type.
 * @author Mark Paluch
 */
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.
     */
// Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
//         DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
// 
//     /**
//      * Authenticate to the server.
//      *
//      * @param password the password
//      * @return String simple-string-reply
//      */
//     RedisFuture<String> auth(String password);
// 
//     /**
//      * Close the connection. The connection will become not usable anymore as soon as this method was called.
//      */
//     void close();
// 
//     /**
//      *
//      * @return the underlying connection.
//      */
//     DisqueConnection<K, V> getConnection();
// 
//     /**
//      * 
//      * @return true if the connection is open (connected and not closed).
//      */
//     boolean isOpen();
// 
//     /**
//      * Ping the server.
//      *
//      * @return simple-string-reply
//      */
//     RedisFuture<String> ping();
// 
//     /**
//      * Close the connection.
//      * 
//      * @return String simple-string-reply always OK.
//      */
//     RedisFuture<String> quit();
// 
// }
// 
// Path: src/main/java/biz/paluch/spinach/api/rx/DisqueReactiveCommands.java
// public interface DisqueReactiveCommands<K, V> extends DisqueJobReactiveCommands<K, V>, DisqueQueueReactiveCommands<K, V>,
//         DisqueServerReactiveCommands<K, V>, DisqueClusterReactiveCommands<K, V> {
// 
//     /**
//      * Authenticate to the server.
//      *
//      * @param password the password
//      * @return String simple-string-reply
//      */
//     Observable<String> auth(String password);
// 
//     /**
//      * Close the connection. The connection will become not usable anymore as soon as this method was called.
//      */
//     void close();
// 
//     /**
//      *
//      * @return the underlying connection.
//      */
//     DisqueConnection<K, V> getConnection();
// 
//     /**
//      * 
//      * @return true if the connection is open (connected and not closed).
//      */
//     boolean isOpen();
// 
//     /**
//      * Ping the server.
//      *
//      * @return simple-string-reply
//      */
//     Observable<String> ping();
// 
//     /**
//      * Close the connection.
//      * 
//      * @return String simple-string-reply always OK.
//      */
//     Observable<String> quit();
// 
// }
// 
// Path: src/main/java/biz/paluch/spinach/api/sync/DisqueCommands.java
// public interface DisqueCommands<K, V> extends DisqueJobCommands<K, V>, DisqueQueueCommands<K, V>, DisqueServerCommands<K, V>,
//         DisqueClusterCommands<K, V> {
// 
//     /**
//      * Authenticate to the server.
//      *
//      * @param password the password
//      * @return String simple-string-reply
//      */
//     String auth(String password);
// 
//     /**
//      * Close the connection. The connection will become not usable anymore as soon as this method was called.
//      */
//     void close();
// 
//     /**
//      *
//      * @return the underlying connection.
//      */
//     DisqueConnection<K, V> getConnection();
// 
//     /**
//      *
//      * @return true if the connection is open (connected and not closed).
//      */
//     boolean isOpen();
// 
//     /**
//      * Ping the server.
//      *
//      * @return simple-string-reply
//      */
//     String ping();
// 
//     /**
//      * Close the connection.
//      * 
//      * @return String simple-string-reply always OK.
//      */
//     String quit();
// 
//     /**
//      * Set the default timeout for operations.
//      *
//      * @param timeout the timeout value
//      * @param unit the unit of the timeout value
//      */
//     void setTimeout(long timeout, TimeUnit unit);
// }


// Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
import biz.paluch.spinach.api.async.DisqueAsyncCommands;
import biz.paluch.spinach.api.rx.DisqueReactiveCommands;
import biz.paluch.spinach.api.sync.DisqueCommands;
import com.lambdaworks.redis.api.StatefulConnection;

/*
 * Copyright 2016 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package biz.paluch.spinach.api;



/**
 * A thread-safe connection to a redis server. Multiple threads may share one {@link DisqueConnection}.
 * 
 * A {@link com.lambdaworks.redis.protocol.ConnectionWatchdog} monitors each connection and reconnects automatically until
 * {@link #close} is called. All pending commands will be (re)sent after successful reconnection.
 * 
 * @param <K> Key type.
 * @param <V> Value type.
 * @author Mark Paluch
 */
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();