// 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/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.DisqueConnection;
import biz.paluch.spinach.api.sync.DisqueCommands;
/*
 * 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;


/**
 * @author Mark Paluch
 */
public class Example {

    public static void main(String[] args) {
        String nodes = System.getenv("TYND_DISQUE_NODES");
        String auth = System.getenv("TYND_DISQUE_AUTH");
        DisqueClient disqueClient = new DisqueClient("disque://" + auth + "@" + nodes);

        DisqueCommands<String, String> connection = disqueClient.connect().sync();
        System.out.println(connection.ping());
        connection.close();
// 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/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/test/java/biz/paluch/spinach/Example.java
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.api.sync.DisqueCommands;

/*
 * 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;


/**
 * @author Mark Paluch
 */
public class Example {

    public static void main(String[] args) {
        String nodes = System.getenv("TYND_DISQUE_NODES");
        String auth = System.getenv("TYND_DISQUE_AUTH");
        DisqueClient disqueClient = new DisqueClient("disque://" + auth + "@" + nodes);

        DisqueCommands<String, String> connection = disqueClient.connect().sync();
        System.out.println(connection.ping());
        connection.close();
        disqueClient.shutdown();