Skip to content

Instantly share code, notes, and snippets.

@smaldini
Created August 3, 2012 00:08
Show Gist options
  • Save smaldini/3242409 to your computer and use it in GitHub Desktop.
Save smaldini/3242409 to your computer and use it in GitHub Desktop.
test
class SomeController{
def testInlineListener = {
//register with 'logout' topic on 'app' default namespace
def listener = on("logout") {User user ->
println "test $user"
}
render "$listener registered"
}
def testInlineListener2 = {
//register a 'gorm' namespaced handler on 'afterInsert' topic.
def listener = on("gorm", "afterInsert") {Book book ->
println "test $book"
}
render "$listener registered"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment