The disconnect event is fired by atmosphere under the hood (AtmosphereResourceEventListener.onDisconnect). Further reading here:
https://github.com/Atmosphere/atmosphere/wiki/onDisconnect-tricks http://atmosphere.github.io/atmosphere/apidocs/org/atmosphere/cpr/AtmosphereResourceEventListener.html If you'll notice in the chat demo, I use a HttpSessionListener to cleanup any chat users that might not have disconnected https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/webapp/WEB-INF/web.xml https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/services/ChatHttpSessionListener.java On 15 Jun 2014 02:41, "Bogdan Ivascu" <ivascu.bogdan...@gmail.com> wrote: > Sorry, not that I read it, I should have been more specific. I do see the > contribution of the ChatTopicListener in AppModule and the "onConnect" > method gets called as expected when any push target creates a new > AtmosphereResource. The one that I don't see called is the "onDisconnect" > method. > > > On Sat, Jun 14, 2014 at 8:42 PM, Bogdan Ivascu <ivascu.bogdan...@gmail.com > > > wrote: > > > Hi Lance, > > What is the way to listen for someone connecting and disconnecting from > > a topic? I see that you have "TopicListenerImpl" and > > "ChatTopicListenerImpl" having methods that listen for this type of > thing. > > I don't see how they are used though. > > > > Thanks, > > Bogdan. > > > > > > On Wed, May 21, 2014 at 3:33 AM, Lance Java <lance.j...@googlemail.com> > > wrote: > > > >> I've implemented this feature in tapestry-cometd but it's not been > >> implemented in tapestry-atmosphere yet. I think it's only a couple of > >> lines > >> of javascript. > >> > >> I have just updated the outstanding issue with a possible solution here: > >> https://github.com/uklance/tapestry-atmosphere/issues/5 > >> > >> Pull requests welcomed!! > >> On 21 May 2014 04:21, "Bogdan Ivascu" <ivascu.bogdan...@gmail.com> > wrote: > >> > >> > I ended up using your atmosphere implementation and it works like a > >> charm, > >> > so many thanks for that. I have an additional questions though. When > >> > returning the block to the client, basically your ChatDemo class > >> > ( > >> > > >> > > >> > https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere-demo/src/main/java/org/lazan/t5/atmosphere/demo/pages/ChatDemo.java#L65 > >> > ) > >> > ->onChatMessage method, I want to be able to execute some client > >> > javascript > >> > that will parse a Long number and make it into a date using momentjs. > >> Where > >> > can I patch in this piece of code? I tried changing the return type of > >> the > >> > method to void and using AjaxRespRenderer to display the block and > then > >> > call the javascript without much success. What would be a good > solution > >> > here, listen on the client side for some event to be triggered or > >> somehow > >> > make an ajax addScript() call from the server. > >> > > >> > Thanks, > >> > Bogdan. > >> > > >> > > >> > On Tue, May 13, 2014 at 12:15 PM, Bogdan Ivascu > >> > <ivascu.bogdan...@gmail.com>wrote: > >> > > >> > > Hi Lance, > >> > > I did see numerous discussions around your implementation. My goal > >> here > >> > > is to try and get a better understanding of where and how this > >> framework > >> > > can be extended. I am however pressed for time and if I cannot get > it > >> to > >> > > work, I will most likely end up using your implementation. > >> > > > >> > > Thanks, > >> > > Bogdan. > >> > > > >> > > > >> > > On Tue, May 13, 2014 at 3:34 AM, Lance Java < > >> lance.j...@googlemail.com > >> > >wrote: > >> > > > >> > >> Take a look at tapestry-atmosphere [1] and tapestry-cometd [2] > >> > >> > >> > >> [1] https://github.com/uklance/tapestry-atmosphere > >> > >> [2] https://github.com/uklance/tapestry-cometd > >> > >> On 13 May 2014 02:10, "Bogdan Ivascu" <ivascu.bogdan...@gmail.com> > >> > wrote: > >> > >> > >> > >> > Hi everyone, > >> > >> > I want to add webSocket support for my tapestry project and > need > >> a > >> > few > >> > >> > pointers. What I have is a dead simple Servlet, implementing the > >> java > >> > >> > WebSocket api. I would like to bring this servlet into my > tapestry > >> > >> project > >> > >> > and have it managed by tapestry itself. To be more clear, I don't > >> want > >> > >> to > >> > >> > use the ignore path functionality to expose it, but rather have > >> > >> tapestry's > >> > >> > filter control the access to this servlet. > >> > >> > > >> > >> > The biggest problem that I have right now is that I don't have a > >> clear > >> > >> > understanding of what I need to do to make this happen. Will this > >> > >> servlet > >> > >> > be a service or a page with no tml, where would it sit, how do I > >> > >> configure > >> > >> > tapestry so that it knows to create a new instance for each > >> request. > >> > >> > > >> > >> > A nudge of where I could document myself regarding this type of > >> > >> integration > >> > >> > would be most welcome. > >> > >> > > >> > >> > Thank you, > >> > >> > Bogdan. > >> > >> > > >> > >> > >> > > > >> > > > >> > > >> > > > > >