Thanks Lance,

So if I have one shared topic that each client is subscribed to how do I push 
an event to a specific client?  Presumably by adding some context (a 
"memberId") to each event and having each client only consume messages with 
their member id?  Or would the approach be to create a per-member-id topic?  At 
the very least I imagine needing a per-game topic so that I can have lots of 
games running concurrently without having too much dead traffic for each client.

Cheers,
Ben.

> Date: Thu, 5 Sep 2013 13:46:08 +0100
> Subject: RE: Tapestry Server Push/Web Socket/Comet implementation
> From: lance.j...@googlemail.com
> To: users@tapestry.apache.org
> 
> Hi Ben,
> 
> I'm sure tapestry-cometd can handle this. Just add a PushTarget component
> to each user's page providing a "topic" and an "event". Messages are pushed
> to the PushTargets via PushManager.broadcast(topic, message). Every message
> will fire the component event and will either return a block or add a
> script via the AjaxResponseRenderer (or both). The response is then pushed
> to the client. Block updates will either append or prepend to the
> PushTarget's element or will replace the current contents.
> 
> One improvement that could be made to tapestry-cometd is to allow 1
> PushTarget to subscribe to multiple topics. This way each user could have a
> private topic (for peer to peer messages) and a public topic that everyone
> can see. The current workaround is to have two PushTargets on a page.
> 
> More info here:
> https://github.com/uklance/tapestry-cometd/wiki/Pushing-javascript-to-the-client
> https://github.com/uklance/tapestry-cometd
> 
> Demo app here:
> https://github.com/uklance/tapestry-cometd-demo
                                          

Reply via email to