$rpc = new Goridge\RPC\RPC(Goridge\Relay::create('tcp://0.0.0.0:1234'));
$a['addredss'] = "trrrrrrrrrrrrrrrrjdjd";
$a['money'] = "0.123";
$rpc->call("App.Hi",json_encode($a));
以上是代碼,我不想每次在使用時(shí)都去連接一次TCP地址
$rpc = new Goridge\RPC\RPC(Goridge\Relay::create('tcp://0.0.0.0:1234'));
怎么才能像redis 或者 數(shù)據(jù)庫(kù)一樣,只在啟動(dòng)時(shí)鏈接1次,然后后續(xù)可以在任何控制器方法中直接使用
$rpc->call("App.Hi",json_encode($a));