mead 3306150664 init | %!s(int64=2) %!d(string=hai) anos | |
---|---|---|
.. | ||
resources | %!s(int64=2) %!d(string=hai) anos | |
src | %!s(int64=2) %!d(string=hai) anos | |
CHANGELOG.md | %!s(int64=2) %!d(string=hai) anos | |
LICENSE | %!s(int64=2) %!d(string=hai) anos | |
README.md | %!s(int64=2) %!d(string=hai) anos | |
codecov.yml | %!s(int64=2) %!d(string=hai) anos | |
composer.json | %!s(int64=2) %!d(string=hai) anos | |
infection.json.dist | %!s(int64=2) %!d(string=hai) anos |
Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package. The library allows you to call Go service methods from PHP with minimal footprint, structures and []byte
support.
See https://github.com/spiral/roadrunner - High-performance PHP application server, load-balancer and process manager written in Golang
net/rpc
integration, ability to connect to existed application(s)[]byte
transfer, including big payloadscomposer require spiral/goridge
<?php
use Spiral\Goridge;
require "vendor/autoload.php";
$rpc = new Goridge\RPC\RPC(
Goridge\Relay::create('tcp://127.0.0.1:6001')
);
//or, using factory:
$tcpRPC = new Goridge\RPC\RPC(Goridge\Relay::create('tcp://127.0.0.1:6001'));
$unixRPC = new Goridge\RPC\RPC(Goridge\Relay::create('unix:///tmp/rpc.sock'));
$streamRPC = new Goridge\RPC\RPC(Goridge\Relay::create('pipes://stdin:stdout'));
echo $rpc->call("App.Hi", "Antony");
Factory applies the next format:
<protocol>://<arg1>:<arg2>
More examples can be found in this directory.
The MIT License (MIT). Please see LICENSE
for more information.