$options = [
'max_conn_per_addr' => 128,
'keepalive_timeout' => 15,
'connect_timeout' => 30,
'timeout' => 600,
];
$client = new Client($options);
$client->request($uri, [
'method' => 'POST',
'version' => '1.1',
'data' => json_encode($data),
'headers' => [
'Authorization' => "Bearer {$appKey}",
'X-DashScope-SSE' => 'enable',
],
'progress' => function ($buffer) use ($onMessage) {
$this->debug && $this->stdoutLogger->info($buffer);
},
]);
以上代碼的buffer
有時候會是不完整的消息,我發(fā)現(xiàn)這個情況是出現(xiàn)在消息很長的情況下
...內(nèi),表明?
會出現(xiàn)這種數(shù)據(jù),消息短沒有問題,消息長了看起來應(yīng)該是不完整,請問如何處理?