Skip to content

Instantly share code, notes, and snippets.

@squarepegsys
Created October 21, 2015 01:57
Show Gist options
  • Save squarepegsys/e35063934634f0fef957 to your computer and use it in GitHub Desktop.
Save squarepegsys/e35063934634f0fef957 to your computer and use it in GitHub Desktop.
Event-Driven Grails
package grails3.event.driven
import reactor.spring.context.annotation.*
@Consumer
class EchoNumberService {
@Selector('int.echo')
void echo(Integer i) {
println "##### number id ${i}"
}
}
package grails3.event.driven
import grails.transaction.Transactional
class LoopService {
def count(int limit) {
(1..limit).each {
notify( "int.echo",it as Integer)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment