Redis protocol implementation.
use io\redis\RedisProtocol;
$protocol= new RedisProtocol('redis://localhost');
$protocol->command('SET', 'key', 'value');
$value= $protocol->command('GET', 'key');
The port defaults to 6379 and can be changed by adding it as follows: redis://localhost:16379. To use authentication, pass it as username in the connection string, e.g. redis://secret@localhost.
use io\redis\RedisProtocol;
$protocol= new RedisProtocol('redis://localhost');
$protocol->command('SUBSCRIBE', 'messages');
while ($message= $protocol->receive()) {
Console::writeLine('Received ', $message);
}