Skip to content

Instantly share code, notes, and snippets.

@maggedotno
Created October 20, 2012 20:26
Show Gist options
  • Save maggedotno/3924672 to your computer and use it in GitHub Desktop.
Save maggedotno/3924672 to your computer and use it in GitHub Desktop.
ZMQ Pipeline vanilla push
<?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++) {
echo "+";
$socket->send(json_encode('bogus-' . $n));
}
usleep(rand(0, 1000000));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment