first commit

This commit is contained in:
Mr.Qin
2022-08-19 19:48:37 +08:00
commit afdd648b65
3275 changed files with 631084 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
require __DIR__ . '/../vendor/autoload.php';
use Workerman\Worker;
use Workerman\Timer;
use Workerman\RedisQueue\Client;
$worker = new Worker();
$worker->onWorkerStart = function () {
$client = new Client('redis://127.0.0.1:6379');
$client->subscribe('user-1', function($data){
echo "user-1\n";
var_export($data);
});
$client->subscribe('user-2', function($data){
echo "user-2\n";
var_export($data);
});
Timer::add(1, function()use($client){
$client->send('user-1', [666,777]);
});
};
Worker::runAll();