Last week, I was at Devoxx and I attended to a speech of JF Arcan, the head architect of the Atmoshpere framework [1]. While the new coming Servlet 3.0 Async provides
- Method to suspend a response, HttpServletRequest.startAsync()
- Method to resume a response: AsyncContext.complete()
Atmosphere offers:
- Annotation to suspend: @Suspend
- Annotation or resume: @Resume
- Annotation to broadcast (or push) events to the set of suspended responses: @Broadcast
- Annotation to filter and serialize broadcasted events using BroadcasterFilter
In [2], JF Arcand demonstrates how Atmosphere can be used to suspend a request but also broadcasting a message to all suspended threads. Atmoshpere defines the notion of broadcastable and topics.
A topic is a kind a message channel on which broadcastable servlet can listen. Later on, any other client can broadcast messages on this topic and then reaching all suspended-threads.