Created
September 27, 2011 21:13
-
-
Save lorenzo/1246265 to your computer and use it in GitHub Desktop.
zmq logger
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
/** | |
* Publishes a message to using the ZeroMQ protocol | |
* | |
* @param string $type type of message | |
* @param string $message | |
* @return boolean | |
*/ | |
public function write($type, $message) { | |
$context = new ZMQContext(); | |
$publisher = $context->getSocket(ZMQ::SOCKET_PUB); | |
$publisher->bind("tcp://*:5569"); | |
$update = sprintf ("%s %s", $type, message); | |
$publisher->send($update); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment