使用workerman中父进程与子进程OnMessage之间如何互相调用参数的问题

//作为服务器端接收UI发送来的外呼参数
$httpserver = new Worker(‘websocket://0.0.0.0:1000’);

httpserver>onMessage=function( h t t p s e r v e r − > o n M e s s a g e = f u n c t i o n ( conhttp, msg)use( m s g ) u s e ( connection)
{
//获取前端UI页面发送来的参数
//print_r($msg);

};
httpserver>onWorkerStart=function( h t t p s e r v e r − > o n W o r k e r S t a r t = f u n c t i o n ( conhttp)
{
//开启子进程作为客户端连接服务器
$connection = new AsyncTcpConnection(‘tcp://10.10.10.200:8021’);

$connection->onConnect = function($connection)
{
    echo "connect success\n";
};
$connection->onMessage = function($connection,$buffer)use($conhttp)
{
    //如何在此处调用$msg变量
};

你可能感兴趣的:(使用workerman中父进程与子进程OnMessage之间如何互相调用参数的问题)