I’m looking for a neat way to execute a check to see if there are any messages in an inbox (realtime) in a Grails 2.x application. I’ve moved away from polling via ajax to websockets, which is great at the point where someone actually sends you the message, but when you change to another screen, the “count” still needs to be initialized. Can anyone advise on a elegant way of doing this?
- Interceptors are not ideal as I need to check across just about all controllers
- Filters are not ideal because on some screens with graphs there are many ajax request, the check would be run many times for each request.
I’m wondering if there are any other solutions that I’m not thinking of.. but possibly not.