Yar (yet another RPC framework, the leader asked me why are ya head, hehe, because this name is good) is I 3 months ago, in order to solve a practical problem, and developed a PHP extension, RPC framework, and the existing RPC framework (XML-RPC, SOAP), this is a lightweight framework that supports a variety of packaging protocols (Msgpack, JSON, PHP), and one of the most important features is that it is parallelized.
Consider the following scenario:
A traditional Web application, a process, a request, is justified. However, when a request is processed, more data sources are involved, and there is a certain degree of non-dependence between them.
or traditional Web applications, an application with the rapid growth of the business, the flow of developers, will slowly enter a vicious circle, the code of the amount of only add no subtraction. Because as the system becomes complex, the lead will move the whole world, and the new maintainers, the original system and not so much time for him to master. Even with so much time, it is not an easy thing to master the combination of so many defenders ' thinking.
Well, long time before, this system will become more and more non-maintainable .... To a large application into this vicious circle, then all that awaits him is refactoring.
So, can you decouple the system?
We've done a lot of decoupling, data, middleware, business, logic, and so on, all kinds of layering. But to the Web application of this piece, how can you divide it, mvc we have done ....
Based on this, Yar may be able to solve the two problems you encounter ...
Yar is a very lightweight RPC framework, and when I implement Yar, I pursue the ultimate in lightweight, which is very simple to use for server side:
-
- class API {
- /**
- * The DOC info would 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 ();
- ?>
Very similar to SOAP usage? Yes, in this way, your API class will be able to provide services to the outside.
Yar to facilitate development, the document and interface binding together, for the above example, if we are simple GET request this interface address, we will see the following information page:
http://www.bkjia.com/PHPjc/445651.html www.bkjia.com true http://www.bkjia.com/PHPjc/445651.html techarticle Yar (yet another RPC framework, the leader asked me why are ya head, hehe, because this name is good) is I in 3 months ago, in order to solve a practical problem, and developed a php extension ...