Azure SignalR 中的 Default/Serverless/Classic 设置有什么区别?

What is the difference between Default/Serverless/Classic settings in Azure SignalR?

我已经为 REST API 设置了 Azure SignalR 服务。设置下有三种模式:DefaultServerlessClassic。我找不到关于这些项目中每一项设置的任何信息。到目前为止我得到的唯一一件事是,如果我将 Azure SignalR 用于 Azure Functions 或 REST APIs,最好使用 Serverless option.

来自documentation

Change the Service Mode setting to Serverless only if you are using Azure SignalR Service through Azure Functions binding or REST API. Leave it in Classic or Default otherwise.

Serverless mode is not supported for ASP.NET SignalR applications. Always use Default or Classic for the Azure SignalR Service instance.

你能帮我找出每个选项设置的内容吗?

根据Github上的docs,判断是否需要或允许连接到SignalR服务的中心服务器:

Default mode requires hub server. When there is no server connection available for the hub, the client tries to connect to this hub fails.

Serverless mode does NOT allow any server connection, i.e. it will reject all server connections, all clients must in serverless mode.

Classic mode is a mixed status. When a hub has server connection, the new client will be routed to hub server, if not, client will enter serverless mode.

因为在无服务器模式下没有中心服务器,所以您可以做的事情仅限于向特定客户端发送消息或从连接的客户端向所有客户端广播。此外,由于没有集线器,从客户端到 SignalR 服务的消息将通过 HTTP 而不是 Websockets 发送,这可能会引起性能问题,详见 here