Quantcast

grails-events-push and request tracking

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

grails-events-push and request tracking

rsom@certifydatasystems.com
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

smime.p7s (6K) Download Attachment
Loading...