From 11bd2c2aab927f4b4eafc16482e53f734b28073b Mon Sep 17 00:00:00 2001 From: Ma Bingyao Date: Thu, 11 Aug 2016 14:41:24 +0800 Subject: [PATCH] Update examples. --- examples/src/server/PushServer.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/src/server/PushServer.php b/examples/src/server/PushServer.php index 6374ec98..af2e51e3 100644 --- a/examples/src/server/PushServer.php +++ b/examples/src/server/PushServer.php @@ -11,5 +11,11 @@ function hello($name, $context) { $server = new Server("tcp://0.0.0.0:1980"); $server->publish('news'); +$server->onSubscribe = function($topic, $id, $service) { + error_log("client $id subscribe $topic on " . microtime(true)); +}; +$server->onUnsubscribe = function($topic, $id, $service) { + error_log("client $id unsubscribe $topic on " . microtime(true)); +}; $server->addFunction('hello', array('passContext' => true)); $server->start();