RPC: gRPC
gRPC uses protoc
with a special gRPC plugin
to generate code from your proto file: you get generated gRPC client and server code, as well as the regular protocol buffer code for populating, serializing, and retrieving your message types.
The gRPC programming API in most languages comes in both synchronous and asynchronous flavors.
Alternatives are researched
In the last couple years RPC started to become popular again as a communication mechanism for web-based APIs. REST is great for modeling your domain and exposing it under a CRUD-style interface, but RPC is the way to go if your API primarily consist of executable actions (procedures).
For internal-only communication it’s better to use gRPC. Performace: gRPC is 10 times faster and consumes 30% less ressources Benchmarking gRPC+Protobuf vs HTTP+JSON
The Heir to the Throne: gRPC or Thrift
-
Hprose is mostly popular in China. Serialize library of hprose is faster, smaller and more powerful than msgpack; the RPC library is faster, easier and more powerful than thrift.
-
slično je i: https://www.rabbitmq.com/tutorials/tutorial-six-php.html
-
Apache Avro: eliep/avro-rpc-php: An Avro RPC client in PHP
Objašnjenje: https://www.smashingmagazine.com/2016/09/understanding-rest-and-rpc-for-http-apis/
-
There are others also like Twirp
How to
I decided to go with gRPC because it’s ubiquitous.
gRPC has no direct support for building a PHP-based server. This can be done with third-party tools such as the spiral/php-grpc server
Made by google and protocol buffers
PHP can only be client, node.js can be also server and client
gRPC PHP tutorial for microservices architecture | TSH.io The Path To gRPC in Node.js. A simple guide to implementing gRPC… | by Tom Vance | Holiday Extras Tech Team
Tool like cURL, but for gRPC
fullstorydev/grpcurl is cURL-like command-line tool to make requests to gRPC services.
|
|
Usage:
grpcurl -plaintext -proto crawler.proto -d '{ "url": "none" }' 0.0.0.0:1971 vouchers.CrawlerService/Crawl
Desktop tools
If you prefer a desktop tool, BloomRPC is the Postman of gRPC :)
̊rogchap/wombat: Cross platform gRPC client GitHub - getezy/ezy: 🔥 GUI client for gRPC/gRPC-Web
Introducing DRPC: Our Replacement for gRPC