Download the PHP package makaronnik/amphp-rpc without Composer

On this page you can find all versions of the php package makaronnik/amphp-rpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package amphp-rpc

StandWithUkraine

Stand With Ukraine

Amphp RPC

PHP (8.1) Async RPC based on Amp

Installation

This package can be installed as a Composer dependency.

Requirements

Description

This is an RPC (remote procedure calls) package that works in asynchronous, non-blocking mode, based on Amp.
Based on ideas implemented in amphp/rpc, but enhanced with advanced functionality useful for communication and load balancing in microservice architecture.
Used in the Amphp Microservice Framework as one of the main methods of inter-service communication. It also serves as the basis for the Amphp Request Proxy package.

Main features

Creating Remote Objects

Remote objects are, in fact, instances of classes that are generated on the side of the RPC server when an RPC request is received from an RPC client. These classes MUST be on the server side and implement their interfaces. The public methods of these interfaces MUST return an Amp\Promise object or an exception will be thrown. These methods are called Remote Procedures. They will be executed on the server as a result of calling similar methods on the proxy object on the client. In order for this to happen, the map between the remote object's interface and its implementation must be registered. This is done using the registerRemoteObject method of the RpcRegistry object, which is passed to the RpcServer constructor. The identical interface of the remote object MUST be on BOTH the server and the client. An identical interface on the client is needed to create the appropriate proxy for a remote object, on the client side, by calling the createProxy method on the RpcProxyObjectFactory.

Remote Object Interface example:

Remote Object Implementation example:

(Server) Registering a mapping between a remote object's interface and its implementation:

(Client) Creating a remote object proxy and calling its remote method:

Complete examples

You can find complete examples in the test directories.

Main package classes

Server side:

Client side:

Responces factories:

Exceptions:

Versioning

makaronnik/amphp-rpc follows the semver semantic versioning specification.

License

The MIT License (MIT). Please see LICENSE for more information.


All versions of amphp-rpc with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
amphp/amp Version v2.6.*
amphp/file Version *
amphp/socket Version *
amphp/http-client Version *
amphp/http-server Version *
amphp/serialization Version *
amphp/http-server-router Version *
composer-runtime-api Version ^2.1.0
cash/lrucache Version *
laminas/laminas-code Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package makaronnik/amphp-rpc contains the following files

Loading the files please wait ....