Package com.lambdaworks.redis

Examples of com.lambdaworks.redis.RedisConnection


     */
    @Override
    public void run(Timeout timeout) throws Exception {
        ChannelPipeline old = channel.getPipeline();
        CommandHandler handler = old.get(CommandHandler.class);
        RedisConnection connection = old.get(RedisConnection.class);
        ChannelPipeline pipeline = Channels.pipeline(this, handler, connection);

        Channel c = bootstrap.getFactory().newChannel(pipeline);
        c.getConfig().setOptions(bootstrap.getOptions());
        c.connect((SocketAddress) bootstrap.getOption("remoteAddress"));
View Full Code Here


            log.debug("{} freezed", addr);
            connectionEntry.setFreezed(true);

            // close all connections
            while (true) {
                RedisConnection connection = connectionEntry.getConnections().poll();
                if (connection == null) {
                    break;
                }
                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.getConnectionsSemaphore().tryAcquire()) {
                clientsCopy.remove(index);
            } else {
                RedisConnection conn = entry.getConnections().poll();
                if (conn != null) {
                    return conn;
                }
                try {
                    conn = entry.getClient().connect(codec);
                    if (config.getPassword() != null) {
                        conn.auth(config.getPassword());
                    }
                    if (config.getDatabase() != 0) {
                        conn.select(config.getDatabase());
                    }

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

TOP

Related Classes of com.lambdaworks.redis.RedisConnection

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.