Created
September 4, 2016 10:05
-
-
Save dam1r89/9e45952853c3874e5ba3865a2825277f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Workerman\Lib\Timer; | |
use Workerman\Worker; | |
require __DIR__ . '/bootstrap/autoload.php'; | |
Timer::add(0.1, function () { | |
echo "First timer\n"; | |
Timer::add(0.1, function () { | |
echo "Second timer\n"; | |
$udpWorker = new Worker("udp://0.0.0.0:15123"); | |
$udpWorker->onMessage = function ($connection, $data) { | |
echo "Received $data\n"; | |
}; | |
}, null, false); | |
Timer::add(3, function () { | |
echo "Third timer\n" ; | |
}, null, false); | |
}, null, false); | |
\Workerman\Worker::runAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment