It will cause overhead to remove dead channels in the loop, because I must update both memcache and datastore. Right now I do the loop like my first message, and then set cron every 30min to remove dead channels.
I think this is a very common use case and should be handled at lower level (i.e. the Channel API itself). I think lots of app will use Channel API to broadcast message, so there's a need to: - have the list both in memcache and datastore - keep it updated (if channel no longer valid, remove from list) On Feb 6, 5:23 pm, Remigius <[email protected]> wrote: > Having no personal experience with channels so far, the only thing I > can suggest is the following small improvement: > > for each channelId in list { > try { send } catch { remove the affected channel from the list } > > } > > See also channel wish list above... > > Best regards, > > Remigius. > > On Feb 3, 6:59 pm, Thomas Wiradikusuma <[email protected]> wrote: > > > > > > > > > Hi guys, > > > I learn that (at least in Java) ChannelService.sendMessage will throw > > exception when sending to non-existent channel (i.e. channelId no > > longer valid). > > > Now assume this situation: > > Every time someone opens your website, clientId token is generated and > > kept in a list in the server, so you can push them messages. > > Some of them may close the website shortly after visiting. But of > > course our server app doesn't know how to update the list, so it will > > have some dead channelIds. > > > I can handle that by: > > > for each channelId in list { > > try { send } catch (ignore it) > > > } > > > But isn't that slow? Is there any better way to handle this situation? -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
