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.
22 lines
493 B
22 lines
493 B
<?php
|
|
use Workerman\Worker;
|
|
use Workerman\Lib\Timer;
|
|
|
|
// composer autoload
|
|
include __DIR__ . '/../vendor/autoload.php';
|
|
|
|
$channel_server = new Channel\Server();
|
|
|
|
$worker = new Worker();
|
|
$worker->onWorkerStart = function()
|
|
{
|
|
Channel\Client::on('test event', function($event_data){
|
|
echo 'test event triggered event_data :';
|
|
var_dump($event_data);
|
|
});
|
|
Timer::add(5, function(){
|
|
Channel\Client::publish('test event', 'some data');
|
|
});
|
|
};
|
|
|
|
Worker::runAll();
|
|
|