Parallel RPC framework. Yar (yetanotherRPCframework, the instructor asked me why all of them are Ya headers, haha, because the name is so good) I tried to solve a practical problem more than three months ago, one developed PHP extension Yar (yet another RPC framework, the instructor asked me why all of them are Ya's headers, huh, because the name is so good) I was three months ago, to solve a practical problem, the developed RPC framework is different from the existing RPC framework (xml-rpc, soap), which is a lightweight framework, supports multiple packaging protocols (msgpack, json, php), and is parallelized ..
Consider the following scenarios:
Traditional Web applications, a process, and a request, are well handled. However, when a request is processed, it involves multiple data sources and there is no dependency between them.
It is also a traditional Web application. With the rapid growth of the business, the flow of developers will slowly enter a vicious circle, and only addition and subtraction are available for the amount of code. as the system becomes more complex, the system will change the overall situation. The new maintainer does not have that much time to grasp the original system. even with so much time, it is not easy to grasp the combination of the thinking of so many defenders in the past...
In the past, the system will become increasingly unavailable .... When a large application enters this vicious circle, only reconstruction is needed.
So can we decouple this system?
We have already done a lot of decoupling, data, middleware, business, logic, and so on, and various layers. but how can we identify the Web application? MVC has already been done ....
Based on this, Yar may solve these two problems...
Yar is a very lightweight RPC framework. when implementing Yar, I pursue the ultimate lightweight architecture. it is very simple to use. for the Server side:
-
- class API {
- /**
- * the doc info will be generated automatically into service info page.
- * @params
- * @return
- */
- public function api($parameter, $option = "foo") {
- }
-
- protected function client_can_not_see() {
- }
- }
-
- $service = new Yar_Server(new API());
- $service->handle();
- ?>
Is it similar to how Soap is used? Yes. in this way, your API class can provide external services ..
Yar binds the document and interface to facilitate development. for the above example, if we use a simple GET request for this interface address, we will see the following information page:
Http://www.bkjia.com/PHPjc/445651.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445651.htmlTechArticleYar (yet another RPC framework, the instructor asked me why all of them are Ya headers, huh, because the name is so good) is my three months ago, in order to solve a practical problem, developed a PHP extension...