Hi,
In the grails atmosphere plugin, I used to do this:
In the onRequest closure, I would extract a header with request id:
def atmosphereRequestId = event.request.getHeader('x-atmosphere-tracking-id')
Then do the processing asynchronously while passing that atmosphereRequestId around and finally.
In the onStateChange closure, compare that against the request
def atmosphereRequestId = event.resource.request.getHeader(AtmosphereRequestTracker)
if (atmosphereMessage.atmosphereRequestId == atmosphereRequestId) {
...
event.resource.response.writer.write data
event.resource.response.writer.flush
}
How do I send responses only to the correct user with the grails-events-push plugin?
Also is there a way I can use AHC or some other library to access events from groovy code instead of javascript?
R,
rahul