Hiredis::Async contains Perl binding for the asynchronous features of the hiredis C library (https://github.com/antirez/hiredis). Its intended purpose is to allow event loops to easily take advantage of the hiredis async features. If you just want to use these features and don't care about event loop integration you should check out AnyEvent::Hiredis instead.

The main entry point Command is how you interact with the Redis server. It takes two arguments: an array ref containing the Redis command and its arguments, and a callback to call with the reply when it has arrived.

The other commands deal with I/O to and from the server. GetFd returns the socket that's connected to the server. You can use this fd to poll for readablity or writability with an event loop. When this fd is readable, call HandleRead. When the fd is writable and hiredis indicates there are writes to perform, call HandleWrite. Note that under normal circumstances the fd will be writable most of the time. So it's important to enable the callback only when there are outstanding writes. Otherwise your program will use 100% CPU even when idle. Use the available callbacks to determine when there are outstanding writes.

Hiredis::Async needs the underlying hiredis C library. Install it from your package management system or from source: https://github.com/antirez/hiredis . If you install hiredis to anywhere other than /usr/local or /usr then you'll need to set the environment variable HIREDIS_PREFIX before installing this module.