I'm new to GRPC I read the quickstart guide and PHP basics. But I see lot all are using NodeJS to run the server side for grpc. But what I wanted to achieve is use PHP on both ends of grpc and create Server + Client in PHP only.
So it's like Client will send the informtation to server and Server will process the information realtime.
I have checked the test case files ServerTest.php code is below
class ServerTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
}
public function tearDown()
{
}
/**
* @expectedException InvalidArgumentException
*/
public function testInvalidConstructor()
{
$server = new Grpc\Server('invalid_host');
}
/**
* @expectedException InvalidArgumentException
*/
public function testInvalidAddHttp2Port()
{
$this->server = new Grpc\Server([]);
$this->port = $this->server->addHttp2Port(['0.0.0.0:0']);
}
/**
* @expectedException InvalidArgumentException
*/
public function testInvalidAddSecureHttp2Port()
{
$this->server = new Grpc\Server([]);
$this->port = $this->server->addSecureHttp2Port(['0.0.0.0:0']);
}
}
I'm not sure if this is possible any help would be highly appriciated:
thanks
https://roadrunner.dev/ is an application server for PHP that can allow you to achieve this. I took some notes recently while setting it up and published those over there: https://dev.to/khepin/building-a-grpc-server-in-php-3bgc . Hope that helps though the answer comes a bit later after the question.