Files
kiri-rpc/JsonRpcTransporter.php
T
2022-09-23 18:55:46 +08:00

38 lines
545 B
PHP

<?php
namespace Kiri\Rpc;
use Exception;
/**
*
*/
class JsonRpcTransporter implements JsonRpcTransporterInterface
{
use TraitTransporter;
/**
* @param string $content
* @param string $service
* @return string|bool
* @throws RpcServiceException
* @throws Exception
*/
public function push(string $content, string $service): string|bool
{
$client = $this->get_consul($service)->newClient();
$body = $this->request($client, $content);
$client->close();
return $body;
}
}