Hi guys!
I've been using your library since November and it works like a charm.
But here is my problem: time to time my pub-sub script begins to use 100% of CPU and I don't know why. Is there a way to display current count of connections or so? Usually it happens on 5-7 days after running.
My script look pretty small:
$loop = \React\EventLoop\Factory::create();
$pusher = new \Thruway\Peer\Client("wamp.pubsub", $loop);
$pusher->on('open', function ($session) use ($loop) {
$context = new React\ZMQ\Context($loop);
$pull = $context->getSocket(ZMQ::SOCKET_PULL);
$pull->bind('tcp://127.0.0.1:5555');
$pull->on('message', function ($entry) use ($session) {
$entryData = json_decode($entry, true);
$channel = strtolower("{$entryData['event']}.{$entryData['channel']}");
if (isset($channel)) {
$session->publish($channel, $entryData['data']);
}
});
});
$router = new Thruway\Peer\Router($loop);
$router->addInternalClient($pusher);
$router->addTransportProvider(new Thruway\Transport\RatchetTransportProvider("0.0.0.0", 42111));
$router->start();
Hi guys! I've been using your library since November and it works like a charm. But here is my problem: time to time my pub-sub script begins to use 100% of CPU and I don't know why. Is there a way to display current count of connections or so? Usually it happens on 5-7 days after running.
My script look pretty small: