Skip to content

Commit 47d709e

Browse files
committed
Signed-off-by: Andre Aloise <aaloise@gmail.com>
1 parent a429b90 commit 47d709e

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

examples/server-sent-event-example/build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
}
66
dependencies {
77
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
8-
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.6"
9-
classpath "org.grails.plugins:hibernate5:6.0.6"
8+
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.3"
9+
classpath "org.grails.plugins:hibernate5:6.1.6"
1010
}
1111
}
1212

@@ -42,15 +42,17 @@ dependencies {
4242
compile "org.grails:grails-web-boot"
4343
compile "org.grails.plugins:cache"
4444
compile "org.grails.plugins:scaffolding"
45-
compile "org.grails.plugins:rx-mongodb"
46-
compile "org.grails.plugins:rx-gorm-rest-client:1.0.0.M1"
47-
compile project(":rxjava")
45+
compile "org.grails.plugins:events"
46+
compile "org.grails.plugins:async"
47+
compile "org.grails.plugins:rxjava2:2.0.0"
4848
compile 'org.grails.plugins:quartz:2.0.9'
49+
compile 'org.grails:grails-logging'
4950

5051
console "org.grails:grails-console"
5152
profile "org.grails.profiles:web"
52-
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.6"
53+
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.3"
5354
runtime "com.h2database:h2"
55+
runtime "org.grails:grails-events-rxjava2:3.3.0"
5456
testCompile "org.grails:grails-plugin-testing"
5557
testCompile "org.grails.plugins:geb"
5658
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
grailsVersion=3.2.5
2-
gradleWrapperVersion=2.13
1+
grailsVersion=3.3.0
2+
gormVersion=6.1.6.RELEASE
3+
gradleWrapperVersion=3.5

examples/server-sent-event-example/grails-app/controllers/rxjava/demo/TickTockController.groovy

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ import io.reactivex.Observable
77
import io.reactivex.schedulers.Schedulers
88
import io.reactivex.subjects.PublishSubject
99
import io.reactivex.subjects.Subject
10-
import reactor.spring.context.annotation.Consumer
11-
import reactor.spring.context.annotation.Selector
12-
10+
import grails.events.annotation.*
1311
import java.util.concurrent.TimeUnit
1412

1513
/**
1614
* Created by graemerocher on 28/07/2016.
1715
*/
18-
@Consumer
1916
class TickTockController implements RxController {
2017

2118
def index() {
@@ -81,8 +78,8 @@ class TickTockController implements RxController {
8178
Subject subject = PublishSubject.create()
8279
Observable publishedObservable = subject.publish().autoConnect().observeOn(Schedulers.io())
8380

84-
@Selector('MyJob.event')
85-
void myEventListener(Object data) {
81+
@Subscriber("MyJob")
82+
void myEventListener(int data) {
8683
log.info("myEvent listener Thread ${Thread.currentThread().name}")
8784
subject.onNext(data)
8885
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package rxjava.demo
22

3-
import grails.events.Events
3+
import grails.events.*
44

5-
class MyJob implements Events {
5+
class MyJob implements EventPublisher {
66
static triggers = {
77
simple name: 'mySimpleTrigger', startDelay: 1000, repeatInterval: 1000
88
}
@@ -11,11 +11,10 @@ class MyJob implements Events {
1111

1212
static int i = 0
1313

14-
static final String EVENT_NAME = 'MyJob.event'
14+
static final String EVENT_NAME = "MyJob"
1515

1616
def execute(){
1717
log.trace('MyJob.execute()')
18-
19-
notify EVENT_NAME, "${i++}"
18+
notify(EVENT_NAME, "${i++}")
2019
}
21-
}
20+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy