智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
王泽彦 a82651f1d8 项目初始化 11 months ago
..
src 项目初始化 11 months ago
.gitignore 项目初始化 11 months ago
LICENSE 项目初始化 11 months ago
README.md 项目初始化 11 months ago
composer.json 项目初始化 11 months ago

README.md

redis

Asynchronous redis client for PHP based on workerman.

Install

composer require workerman/redis

Usage


require_once __DIR__ . '/vendor/autoload.php';
use Workerman\Redis\Client;
use Workerman\Worker;

$worker = new Worker('http://0.0.0.0:6161');

$worker->onWorkerStart = function() {
    global $redis;
    $redis = new Client('redis://127.0.0.1:6379');
};

$worker->onMessage = function($connection, $data) {
    global $redis;
    $redis->set('key', 'hello world');    
    $redis->get('key', function ($result) use ($connection) {
        $connection->send($result);
    });  
};

Worker::runAll();

Document

http://doc.workerman.net/components/workerman-redis.html