对 Pusher 中存在通道与非存在通道的关联感到困惑
Confusion about presence channels associations with non presence channels in Pusher
创建在线频道是否会自动在同一个命名的非在线频道中显示在线信息,例如
"presence-chat" 显示房间 "chat"
的成员
或
这两个频道是否完全没有关联,它们之间的任何关联都必须由应用程序手动维护?而存在通道只是一种可以任意命名的通道,前缀为"presence-"
因此,如果是后者,那么在聊天室用例中,应该为用户订阅聊天室频道以及聊天室频道的存在,这两个频道的名称可能相似,也可能不相似?
Does creating a presence channel automatically show the presence info in the same named non-presence channel e.g.
"presence-chat" shows members of room "chat"
不,chat
是一个 public 频道,没有任何存在类型数据或功能。
Are these two channels completely un-associated
正确。
and any associations between them must be maintained manually by the app?
是的。但我不确定您为什么要同时使用 chat
和 presence-chat
频道。 public 频道 (chat
) 上可用的所有功能也可在状态频道 (presence-chat
) 上使用。
And the presence channel is just a type of channel that can be arbitrarily named anything with the prefix "presence-"
正确。
有关渠道类型的信息可通过以下方式找到:
https://pusher.com/docs/client_api_guide/client_channels#channel_types
So if it is the latter, then in a chat room use case one should subscribe the user to both the chat room channel as well as the presence of the chat room channel, which may or may not be named similarly?
如上所述,状态通道提供 public 通道的所有功能。因此,无需使用一个可以做所有事情的两个通道。
如果我遗漏了您需要两个使用两种渠道类型的原因,请告诉我。如果是这样,我会更新我的答案。
创建在线频道是否会自动在同一个命名的非在线频道中显示在线信息,例如
"presence-chat" 显示房间 "chat"
的成员或
这两个频道是否完全没有关联,它们之间的任何关联都必须由应用程序手动维护?而存在通道只是一种可以任意命名的通道,前缀为"presence-"
因此,如果是后者,那么在聊天室用例中,应该为用户订阅聊天室频道以及聊天室频道的存在,这两个频道的名称可能相似,也可能不相似?
Does creating a presence channel automatically show the presence info in the same named non-presence channel e.g.
"presence-chat" shows members of room "chat"
不,chat
是一个 public 频道,没有任何存在类型数据或功能。
Are these two channels completely un-associated
正确。
and any associations between them must be maintained manually by the app?
是的。但我不确定您为什么要同时使用 chat
和 presence-chat
频道。 public 频道 (chat
) 上可用的所有功能也可在状态频道 (presence-chat
) 上使用。
And the presence channel is just a type of channel that can be arbitrarily named anything with the prefix "presence-"
正确。
有关渠道类型的信息可通过以下方式找到: https://pusher.com/docs/client_api_guide/client_channels#channel_types
So if it is the latter, then in a chat room use case one should subscribe the user to both the chat room channel as well as the presence of the chat room channel, which may or may not be named similarly?
如上所述,状态通道提供 public 通道的所有功能。因此,无需使用一个可以做所有事情的两个通道。
如果我遗漏了您需要两个使用两种渠道类型的原因,请告诉我。如果是这样,我会更新我的答案。