Php rpc framework: DoraRPC-php Tutorial

Source: Internet
Author: User
Php rpc framework: DoraRPC Dora RPC is the most streamlined RPC based on Swoole's fixed-length Baotou communication protocol.

  • This RPC is based on the most streamlined RPC of the Swoole fixed-length packet header communication protocol.

  • Supports concurrency, monotonic, asynchronous, and synchronization.

  • Currently, only the PHP language version is available, and will be gradually iterated in the future based on the recommendations

  • You can easily and quickly build backend application servers.

  • This open-source interface is used to quickly implement RPC. it is deployed as needed and used for RPC between frontend and backend servers of PHP.

  • Downgrade supporting middleware and services in the future

  • Basic swoole, good performance for large and medium-sized websites

Client code:

$obj = new DoraRPCClient();for ($i = 0; $i < 100000; $i++) {    #single    $ret = $obj->singleAPI("abc", array(234, $i), true);    var_dump($ret);    #multi    $data = array(        "oak" => array("name" => "oakdf", "param" => array("dsaf" => "321321")),        "cd" => array("name" => "oakdfff", "param" => array("codo" => "fds")),    );    $ret = $obj->multiAPI($data, false);    var_dump($ret);}

Server:

$ Server = new DoraRPCServer (); // This must be a class inherited by DoraRPCServer and dowork can work.

Project homepage:Http://www.open-open.com/lib/view/home/1434011480176

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.