1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
【以下的回答经过翻译处理】 我找到了答案,将 forEach 循环改为 for 循环。
原代码如下:
items?.forEach(async (item) => {
await apigwManagementApi.postToConnection(params).promise()
});
改为:
for (const item of items) {
await apigwManagementApi.postToConnection(params).promise()
}
我无法解释原理,但它确实有效,消息即时发送到 WebSocket。
Contenus pertinents
- demandé il y a un an
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an