lua parser and redis2 questions

agentzh agentzh at gmail.com
Sat Jun 4 19:21:00 MSD 2011


On Thu, Jun 2, 2011 at 7:27 AM, gregr401 <nginx-forum at nginx.us> wrote:
>
> This auth + get works great and yields the following as expected:
>
> +OK
> $12
> blahblahblah
>
>
> Goal 1:
> I'd like to be able to strip out the +OK\r\n$12\r\n and be left with the
> actual value of blahblahblah.  Hints or example?
>

As documented in ngx_redis2's README, this module always returns the
raw TCP responses from the remote redis server. You need to parse the
redis response yourself (for example, by combining ngx_lua +
lua-redis-parser).

>
> Goal 2:
> Eventually I'd like to be able to pipeline an 'auth' plus numerous
> 'gets' together and leverage each value, if a $-1 isn't returned for a
> 'get', ie:
>  location /redis2 {
>                set $key $http_host;
>                set $key2 $http_host:some_arbitrary_value;
>                redis2_query auth foobar;
>                redis2_query get $key;
>                redis2_query get $key2;
>                redis2_pass redis-backend;
>  }
>

The latest version of ngx_redis2 fully supports redis command
pipelining. Isn't it working for you?

Regards,
-agentzh



More information about the nginx mailing list