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 | |
$zmq = new ZMQContext(1); | |
$socket = $zmq->getSocket(ZMQ::SOCKET_PULL, 'xyz'); | |
$socket->bind('ipc:///tmp/xyz'); | |
while (true) { | |
$inc = $socket->recv(); | |
echo "-"; |
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 | |
require __DIR__ . '/vendor/autoload.php'; | |
use Ratchet\Wamp\WampServer; | |
use Ratchet\Server\IoServer; | |
use Ratchet\WebSocket\WsServer; | |
$loop = React\EventLoop\Factory::create(); |
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 | |
$zmq = new ZMQContext(1); | |
$socket = $zmq->getSocket(ZMQ::SOCKET_PUSH, 'xyz'); | |
$socket->connect('ipc:///tmp/xyz'); | |
while (true) { | |
$msgs = rand(1, 300); | |
for ($n=0; $n<$msgs; $n++) { |
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 test_pull_vanilla.php | |
^Z | |
[1]+ Stopped php test_pull_vanilla.php | |
$ bg | |
[1]+ php test_pull_vanilla.php & | |
$ time php test_push.php | |
+++++++++++----------+-++--+-++--+-+-++--++--+-+-+++++-----+-++--+-+-+-++--+-+-++--+-+-+-+-+-++--+-++++----++--+-+-+-+-+-+-+-+-++--+-+-+-++--+-+-++--++-+--+-+-+-+-++-+-+-+-+--++--+-+-++--++-+-+-+-+--+-+-+-+-+-++++-+-+--+-+-+-+---+-++--++-+--+-+-+-+-+-+-+-++-+++-++-+--+-+-+-+---+--+-+-+-+++-+--+--+-++-+--+-+-++--+-++-+-+--+-+++++-----+-+-++--+-+-+-+-+-+-+-+-+++++++++++++-+--+-+--+-+-+--+-+-----------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------+--+--+---+----+--+---+--+---+---+---+----+--+---+---+---+--+---+--------+----+--+----+---+---+--+---+-+---+--+---+-+---+--+---+--+---+-+--+---+--+---+--+--+--+-+---+-+-+---+----------------------------------------------------- |
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 test_pull_react.php | |
^Z | |
[1]+ Stopped php test_pull_react.php | |
$ bg | |
[1]+ php test_pull_react.php & | |
$ time php test_push.php | |
+++++++++++++++++++++--------------------++++----+-+-+--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------- |