From 26fa02c469c7b9621c2f61aefb5a79e7daa77c45 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 3 Dec 2013 08:03:54 +0000 Subject: [PATCH] Update example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332245 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/yar/yar_concurrent_client/call.xml | 8 ++++++-- reference/yar/yar_concurrent_client/loop.xml | 20 ++++++++++++++++---- reference/yar/yar_server/construct.xml | 1 + 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/reference/yar/yar_concurrent_client/call.xml b/reference/yar/yar_concurrent_client/call.xml index 3bf47291bc..7b8378a0be 100644 --- a/reference/yar/yar_concurrent_client/call.xml +++ b/reference/yar/yar_concurrent_client/call.xml @@ -85,10 +85,12 @@ function error_callback($type, $error, $callinfo) { Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback"); Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters")); // if the callback is not specificed, // callback in loop will be used -Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", array(YAR_OPT_PACKAGER => "json")); +Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", NULL, array(YAR_OPT_PACKAGER => "json")); //this server accept json packager -Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", array(YAR_OPT_TIMEOUT=>1)); +Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", NULL, array(YAR_OPT_TIMEOUT=>1)); //custom timeout + +//The requests are not sent yet ?> ]]> @@ -105,6 +107,8 @@ Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters &reftitle.seealso; Yar_Concurrent_Client::loop + Yar_Server::__construct + Yar_Server::handle diff --git a/reference/yar/yar_concurrent_client/loop.xml b/reference/yar/yar_concurrent_client/loop.xml index 96aca6106d..b5ed52add1 100644 --- a/reference/yar/yar_concurrent_client/loop.xml +++ b/reference/yar/yar_concurrent_client/loop.xml @@ -64,9 +64,10 @@ "json")); +Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", NULL, array(YAR_OPT_PACKAGER => "json")); //this server accept json packager -Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", array(YAR_OPT_TIMEOUT=>1)); +Yar_Concurrent_Client::call("http://host/api/", "some_method", array("parameters"), "callback", NULL, array(YAR_OPT_TIMEOUT=>1)); //custom timeout Yar_Concurrent_Client::loop("callback", "error_callback"); //send the requests, @@ -91,6 +92,15 @@ Yar_Concurrent_Client::loop("callback", "error_callback"); //send the requests, &example.outputs.similar; @@ -101,6 +111,8 @@ Yar_Concurrent_Client::loop("callback", "error_callback"); //send the requests, &reftitle.seealso; Yar_Concurrent_Client::call + Yar_Server::__construct + Yar_Server::handle diff --git a/reference/yar/yar_server/construct.xml b/reference/yar/yar_server/construct.xml index 40fee10ff6..d0c4352489 100644 --- a/reference/yar/yar_server/construct.xml +++ b/reference/yar/yar_server/construct.xml @@ -55,6 +55,7 @@ class API { * @return */ public function some_method($parameter, $option = "foo") { + return "some_method"; } protected function client_can_not_see() {