我需要从php脚本发布消息,我可以很好地发布一条消息。但是现在我需要循环发布不同的消息,找不到正确的方法,这是我尝试过的:$counter=0;$closure=function(\Thruway\ClientSession$session)use($connection,&$counter){//$counterwillbealways5$session->publish('com.example.hello',['Hello,worldfromPHP!!!'.$counter],[],["acknowledge"=>true])->then(function()use($conne