Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 channel 的几个问题 #6

Closed
iyuhang opened this issue Sep 14, 2019 · 5 comments
Closed

关于 channel 的几个问题 #6

iyuhang opened this issue Sep 14, 2019 · 5 comments

Comments

@iyuhang
Copy link
Contributor

iyuhang commented Sep 14, 2019

1.用于实现群的需求,但看这个限制,只能同时创建20个不同的频道,这个会影响群的创建个数吗??

RTM 支持同时创建最多 20 个不同的频道实例并加入到多个频道中,但是每个频道实例必须使用不同的频道 ID 以及不同的回调。

2.一个 channel 一旦创建之后,是不是只要不调用 release 就会一直存在,在 channel 内的用户都能收到消息?用户在 channel 里的关系是否一直保留的呢?

3.channel 点对点的 消息是支持漫游的吗:用户当时不线,几天后登录能再收到消息吗?如果是漫游的,保存时间是多长?

4.类似群的场景,加入了很多个channel 后,需要建立每个对应 channel 的监听,来收消息吗?

@plutoless
Copy link
Contributor

  1. Rtm没有群的概念,频道同时只能创建20个
  2. 是的,你release只是release自己的channel对象并从channel离开,并不影响channel本身
  3. 频道消息不支持离线,点对点消息支持,离线消息的保存时间请参考文档
  4. 是的 如果想收对应频道的群消息,必须加入频道并监听

@iyuhang
Copy link
Contributor Author

iyuhang commented Sep 14, 2019

1.同时创建最多20个是针对单个用户而言的吧?即每个用户可同时加入或者创建总共20个频道?但总数其实是不限20个?

@plutoless
Copy link
Contributor

是的 你登入rtm后 一个session内你只能同时加入20个频道,整体频道数没有限制

@iyuhang
Copy link
Contributor Author

iyuhang commented Sep 14, 2019

明白了
1.用着实现传统群的需求是不行的,因为用户很有可能加入超过20个群,而且需要每个加入过未解散的群都能收到消息。这个限制有必要吗,可以去除吗
4._client.onMessageReceived 只能监听到点对点的消息。 channel.onMessageReceived 能监听到 channel 的消息,加入多个 channel 需要每个都绑定独立事件,但消息监听我们需要做成一个全局的 provider,实现想来会比较麻烦。如果能在_client.onMessageReceived 这个 channel 的上层监听所有的 channel 消息,只是消息类型不同感觉会好一点?

@plutoless
Copy link
Contributor

基本上RTM不是完全设计用来做IM功能的SDK,他和IM SDK还是有区别的,更多是为了和其他用户实时信号互动的作用,因此你提到的这些限制都是为了实现更低延时和更高互动性进而限制的东西

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants