This repository has been archived by the owner. It is now read-only.
Asynchronous redis client library for PHP. Built-in connection pool.
PHP
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2c36da2 Nov 17, 2014
Permalink
Failed to load latest commit information.
src/Swoole/Async Update multi line parser Nov 17, 2014
tests Fixed get big result failed. Nov 4, 2014
.gitignore ignore idea file Nov 13, 2014
README.md update readme Oct 30, 2014
run.php Async Redis Oct 29, 2014
server.php Update server.php Oct 30, 2014

README.md

redis-async

  • event-based, asynchronous non-blocking
  • built-in connection pool
  • support concurrent requests

How to use

####1. Install swoole extension

pecl install swoole

####2. Run example code

require __DIR__.'/src/Swoole/Async/RedisClient.php';
$redis = new Swoole\Async\RedisClient('127.0.0.1');

$redis->select('2', function () use ($redis) {
    $redis->set('key', 'value-rango', function ($result, $success) use ($redis) {
        for ($i = 0; $i < 3; $i++) {
            $redis->get('key', function ($result, $success) {
                echo "redis ok:\n";
                var_dump($success, $result);
            });
        }
    });
});