【发布时间】:2019-07-05 12:27:14
【问题描述】:
实现它是可行的,但我已经读到,由于 Cloud Functions 的设计方式,它们并不是使用 socket.io 的最佳方式。为什么?
【问题讨论】:
标签: firebase socket.io google-cloud-functions
实现它是可行的,但我已经读到,由于 Cloud Functions 的设计方式,它们并不是使用 socket.io 的最佳方式。为什么?
【问题讨论】:
标签: firebase socket.io google-cloud-functions
实际上,socket.io 不适用于 Cloud Functions。 Cloud Functions 具有以下属性,使其与长寿命套接字连接不兼容:
另见
【讨论】:
Cloud Functions 是为简单的请求而设计的,它们不是为长时间运行的进程而设计的。如果您想坚持使用无服务器架构,请尝试 Cloud Run。他们在今年(2021 年 1 月)发布了更新,该平台现在能够支持包括 Socket.io 在内的 WebSocket。
【讨论】: