1

Is there any way to get the Channel ID on the server or transmit it inside a RequestFactory call?

Situation:

  • User starts the application, a channel is being opened.
  • User persists an entity with RequestFactory (requests.persist().using(...).fire(...)).
  • The persist() method on the server pings all connected clients to tell them that the entity has been updated.

But the user that made the initial change doesn't have to be pinged. Is there a way to find out which client made the change? It's not enough to know the user, because one user may have opened several windows (channels).

4

1 回答 1

0

老实说,我还没有使用过 Channel API,但根据文档,每个客户端都被视为单独的用户。所以解决方案超出了 GAE API,我认为你有两个选择:

  1. 在将映射到可能多个通道的客户端上创建逻辑用户 ID。这样你就会知道要跳过哪些频道。
  2. 无论如何 Ping 所有通道,但发送新持久实体的数字版本。然后客户端会将收到的版本与它拥有的版本进行比较,如果它更高,则意味着它需要findModel(id)再次调用。
于 2012-03-02T22:36:15.700 回答