Created
October 21, 2015 01:57
-
-
Save squarepegsys/e35063934634f0fef957 to your computer and use it in GitHub Desktop.
Event-Driven Grails
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
package grails3.event.driven | |
import reactor.spring.context.annotation.* | |
@Consumer | |
class EchoNumberService { | |
@Selector('int.echo') | |
void echo(Integer i) { | |
println "##### number id ${i}" | |
} | |
} |
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
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