什么是 SignalR Hub 以及如何重命名它?

What is a SignalR Hub and how can it be renamed?

在我的 Azure Function 中,我定义了一个 hubName,但我似乎找不到任何文档,它实际上是什么以及如何更改它。如果我在我的函数中将它从默认 "chat" 更改为它不再起作用但是它在哪里定义呢?

{
  "disabled": false,
  "bindings": [
    {
      "authLevel": "anonymous",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    },
    {
      "type": "signalRConnectionInfo",
      "name": "connectionInfo",
      "userId": "{userId}",
      "hubName": ????,   <------------------------------------------
      "direction": "in"
    }
  ]
}

SignalR 集线器是一种将连接逻辑分组为 documented

的方法

以聊天应用程序为例。一组用户可以是同一个集线器的一部分,该集线器允许在组中的用户之间发送消息。

这里的hubName可以是任何字符串,用于限定客户端之间发送的消息的范围。您的所有客户端都必须连接到同一个集线器才能看到正在发送的消息。