Is CURL suitable for api Gateway Development in php? Are there other methods? Is CURL suitable for api Gateway Development in php? Are there other methods?
Reply content:
Is CURL suitable for api Gateway Development in php? Are there other methods?
Curl can be used, but the performance is unknown.
PHP supports socket
The best method is nginx and node. js -- highly concurrent asynchronous I/O Server
Other methods such as erlang, golang, and jvm nio (netty vertx) are more suitable and faster than PHP.
In fact, I have never tried it. I have heard a lot about it. I have never seen a pig run. It's not necessarily true. I hope it will help you.
If you think PHP's curl performance is not good enough, you can use the PECL developed by pure C to expand Swoole. With the support of Swoole, you can use PHP to implement high-performance asynchronous multi-thread server.
Http://www.swoole.com/
The live video of huya game is based on PHP + Swoole to implement the TCP persistent connection PUSH Service. With only two machines, 0.5 million people can be connected online at the same time, and 0.1 million messages can be pushed per second at the peak. A complete PUSH Service solution is established, which provides mobile online/offline push, message persistence, online user and device status management, broadcast Task Distribution queue, external call API, and other functions.