Package com.lambdaworks.redis.pubsub

Examples of com.lambdaworks.redis.pubsub.RedisPubSubConnection


                connection.close();
            }

            // close all pub/sub connections
            while (true) {
                RedisPubSubConnection connection = connectionEntry.pollFreeSubscribeConnection();
                if (connection == null) {
                    break;
                }
                connection.close();
            }


            boolean allFreezed = true;
            for (SubscribesConnectionEntry entry : clients) {
View Full Code Here


            if (entry.isFreezed()
                    || !entry.getSubscribeConnectionsSemaphore().tryAcquire()) {
                clientsCopy.remove(index);
            } else {
                try {
                    RedisPubSubConnection conn = entry.pollFreeSubscribeConnection();
                    if (conn != null) {
                        return conn;
                    }
                    conn = entry.getClient().connectPubSub(codec);
                    if (config.getPassword() != null) {
                        conn.auth(config.getPassword());
                    }
                    if (config.getDatabase() != 0) {
                        conn.select(config.getDatabase());
                    }

                    entry.registerSubscribeConnection(conn);
                    return conn;
                } catch (RedisConnectionException e) {
View Full Code Here

    @Override
    RedisPubSubConnection nextPubSubConnection() {
        acquireSubscribeConnection();

        RedisPubSubConnection conn = ((SubscribesConnectionEntry)masterEntry).pollFreeSubscribeConnection();
        if (conn != null) {
            return conn;
        }

        try {
            conn = masterEntry.getClient().connectPubSub(codec);
            if (config.getPassword() != null) {
                conn.auth(config.getPassword());
            }
            if (config.getDatabase() != 0) {
                conn.select(config.getDatabase());
            }
            return conn;
        } catch (RedisConnectionException e) {
            ((SubscribesConnectionEntry)masterEntry).getSubscribeConnectionsSemaphore().release();
            throw e;
View Full Code Here

TOP

Related Classes of com.lambdaworks.redis.pubsub.RedisPubSubConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.