public <K, V> RedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec) {
        BlockingQueue<Command<K, V, ?>> queue = new LinkedBlockingQueue<Command<K, V, ?>>();

        PubSubCommandHandler<K, V> handler = new PubSubCommandHandler<K, V>(queue, codec);
        RedisPubSubConnection<K, V> connection = new RedisPubSubConnection<K, V>(queue, codec, timeout, unit);

        return connect(handler, connection);
    }
public < K , V > RedisPubSubConnection < K , V > connectPubSub ( RedisCodec < K , V > codec ) { BlockingQueue < Command < K , V , ? > > queue = new LinkedBlockingQueue < Command < K , V , ? > > ( ) ; PubSubCommandHandler < K , V > handler = new PubSubCommandHandler < K , V > ( queue , codec ) ; RedisPubSubConnection < K , V > connection = new RedisPubSubConnection < K , V > ( queue , codec , timeout , unit ) ; return connect ( handler , connection ) ; }
Open a new pub/sub connection to the redis server. Use the supplied
{@link RedisCodec codec} to encode/decode keys and values.

@param codec Use this codec to encode/decode keys and values.

@return A new pub/sub connection.