Skip to content

Instantly share code, notes, and snippets.

@emedina
Created January 17, 2012 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emedina/1628072 to your computer and use it in GitHub Desktop.
Save emedina/1628072 to your computer and use it in GitHub Desktop.
class Atmosphere1Service {
static transactional = false
static atmosphere = [mapping: '/atmosphere/atmosphere1']
def onRequest = { event ->
event.suspend()
}
def onStateChange = { event ->
if (event.message) {
println event
if (event.isSuspended()) {
event.resource.response.writer.with {
write event.message
flush()
}
event.resume()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment