소재지 ₍₍◝(・'ω'・)◟⁾⁾ 🐟️?看XM(^_−)☆哈先看看刚看过卡卡国看过了回来冷藏柜好极过估计 PNG %k25u25%fgd5n!# React/ZMQ ZeroMQ bindings for React. [![Build Status](https://secure.travis-ci.org/friends-of-reactphp/zmq.png?branch=master)](http://travis-ci.org/friends-of-reactphp/zmq) ## Install The recommended way to install react/zmq is [through composer](http://getcomposer.org). ```bash composer require react/zmq ``` ## Example And don't forget to autoload: ```php getSocket(ZMQ::SOCKET_PUSH); $push->connect('tcp://127.0.0.1:5555'); $i = 0; $loop->addPeriodicTimer(1, function () use (&$i, $push) { $i++; echo "sending $i\n"; $push->send($i); }); $loop->run(); ``` And the pull socket that goes with it: ```php getSocket(ZMQ::SOCKET_PULL); $pull->bind('tcp://127.0.0.1:5555'); $pull->on('error', function ($e) { var_dump($e->getMessage()); }); $pull->on('message', function ($msg) { echo "Received: $msg\n"; }); $loop->run(); ``` ## Todo * Integration tests * Buffer limiting * Do not push messages if no listener ## Tests To run the test suite, you need PHPUnit. $ phpunit ## License MIT, see LICENSE.