Channel API and "fan out" to multiple clients

362 views
Skip to first unread message

Andrew Mackenzie

unread,
Oct 8, 2012, 1:17:10 PM10/8/12
to google-a...@googlegroups.com
This overview page for the Channel API


states in the "Caveats" section:

"Only one client at a time can connect to a channel using a given Client ID, so an application cannot use a Client ID for fan-out. In other words, it's not possible to create a central Client ID for connections to multiple clients (For example, you can't create a Client ID for something like a "global-high-scores" channel and use it to broadcast to multiple game clients.)"

I can confirm that you CAN have multiple clients listen on the same channel (via the same Channel ID) and that it works, a single message sent on the channel is received by all listening clients.

Can anyone from google comment?
- is the documentation out of date and the design and implementation do support this
- am I "just lucky" and this could break any time....and I should be planning a redesign

It seems a very useful design feature of channels when pushing out status updates to multiplayer games, group chats and many other use cases.

I have tried having one page (GWT app) listen on more than one channel, and as stated in the Caveats, it seems to NOT work.
As David Bowie would say: "If I say I can't do it, I can't do it, I don't make false claims" :-)

Thanks.

Richard Watson

unread,
Oct 8, 2012, 4:24:02 PM10/8/12
to google-a...@googlegroups.com
I'm sure it's very unlikely to work reliably.  If you need that, until Google makes a policy change I'd suggest using something like Pusher.

Gopal Patel

unread,
Oct 9, 2012, 9:40:23 AM10/9/12
to google-a...@googlegroups.com
its undefined behavior.  they never said it will not work or prohibited. they said undefined.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/BF7hA1CZZiIJ.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Richard Watson

unread,
Oct 9, 2012, 10:05:54 AM10/9/12
to google-a...@googlegroups.com
Seems pretty well defined here:

"One Client Per Client ID

Only one client at a time can connect to a channel using a given Client ID, so an application cannot use a Client ID for fan-out. In other words, it's not possible to create a central Client ID for connections to multiple clients (For example, you can't create a Client ID for something like a "global-high-scores" channel and use it to broadcast to multiple game clients.)"

Aleksei Rovenski

unread,
Oct 9, 2012, 4:10:09 PM10/9/12
to google-a...@googlegroups.com
I remember reading somewhere on StackOverflow that few connections maybe supported to one channel to support same user refreshing the page or smt like that.. How many connections did you test to one channel? 
If you want fan out, please star this issue:
http://code.google.com/p/googleappengine/issues/detail?id=4506

вторник, 9 октября 2012 г., 17:05:54 UTC+3 пользователь Richard Watson написал:

Andrew Mackenzie

unread,
Oct 10, 2012, 5:59:24 AM10/10/12
to google-a...@googlegroups.com
Thanks Aleksei.

I tested on two or three clients only, across machines, browsers and users (geographies).

I have starred the issue you linked to.

Before seeing your post I submitted my own feature request here http://code.google.com/p/googleappengine/issues/detail?id=8242
so, maybe google will merge that one in to the one you reference.

The issue you flagged says it's been escalated to channel engineering team and flagged as "Accepted" which sounds cautiously optimistic.

Jairo Vasquez

unread,
Oct 11, 2012, 1:36:03 PM10/11/12
to google-a...@googlegroups.com
This is very important, please someone from google confirm.

Thanks
Reply all
Reply to author
Forward
0 new messages