Created
January 17, 2012 18:45
-
-
Save emedina/1628072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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