Skip to content

Commit 2e95862

Browse files
Merge pull request ReactiveX#990 from puniverse/master
Quasar integration contrib module
2 parents 14dda8b + 9ae36cf commit 2e95862

15 files changed

+1837
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ bin/
6363

6464
# NetBeans specific files/directories
6565
.nbattrs
66+
/.nb-gradle/profiles/private/
67+
.nb-gradle-properties
6668

6769
# Scala build
6870
*.cache
71+
/.nb-gradle/private/
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# rxjava-quasar
2+
3+
Integrates RxJava with [Quasar](https://github.com/puniverse/quasar).
4+
Includes a fiber (lightweight-thread) based scheduler, and an Observable API for Quasar channels.
5+
6+
Main Classes:
7+
8+
- [NewFiberScheduler](https://github.com/Netflix/RxJava/blob/master/rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/NewFiberScheduler.java)
9+
- [ChannelObservable](https://github.com/Netflix/RxJava/blob/master/rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/ChannelObservable.java)
10+
- [BlockingObservable](https://github.com/Netflix/RxJava/blob/master/rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/BlockingObservable.java)
11+
12+
13+
# Binaries
14+
15+
Binaries and dependency information for Maven, Ivy, Gradle and others can be found at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Ccom.netflix.rxjava).
16+
17+
Example for [Maven](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22rxjava-apache-http%22):
18+
19+
```xml
20+
<dependency>
21+
<groupId>com.netflix.rxjava</groupId>
22+
<artifactId>rxjava-quasar</artifactId>
23+
<version>x.y.z</version>
24+
</dependency>
25+
```
26+
27+
and for Ivy:
28+
29+
```xml
30+
<dependency org="com.netflix.rxjava" name="rxjava-quasar" rev="x.y.z" />
31+
```
32+
33+
# Usage
34+
35+
As always when using Quasar, the java agent has to be started by adding the following JVM option:
36+
37+
```
38+
-javaagent:path-to-quasar-jar.jar
39+
```
40+
41+
Alternatively, you can use AOT instrumentation (see [the Quasar documentation](http://docs.paralleluniverse.co/quasar/#instrumentation)).
42+
43+
Or, if you're running in Tomcat, you can use the Quasar class loader (see [the Comsat documentation](http://docs.paralleluniverse.co/comsat/#enabling-comsat)).
44+
45+
`Observer`, `Function` or `Action` method implementations can call fiber-blocking operations when using the `NewFiberScheduler` if the method is annotated with `@Suspendable`.
46+
(rx-core `Observer`s, `Function`s or `Action`s that manipulate, transform or delegate to other `Observer`s, `Function`s or `Action`s are automatically instrumented).
47+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apply plugin: 'osgi'
2+
3+
sourceCompatibility = JavaVersion.VERSION_1_6
4+
targetCompatibility = JavaVersion.VERSION_1_7
5+
6+
configurations {
7+
quasar
8+
}
9+
10+
repositories {
11+
mavenLocal()
12+
mavenCentral()
13+
// maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
14+
}
15+
16+
dependencies {
17+
compile project(':rxjava-core')
18+
compile 'co.paralleluniverse:quasar-core:0.5.0'
19+
quasar 'co.paralleluniverse:quasar-core:0.5.0'
20+
testCompile project(":rxjava-core").sourceSets.test.output
21+
provided 'junit:junit-dep:4.10'
22+
provided 'org.mockito:mockito-core:1.8.5'
23+
}
24+
25+
jar {
26+
manifest {
27+
name = 'rxjava-quasar'
28+
instruction 'Bundle-Vendor', 'Netflix'
29+
instruction 'Bundle-DocURL', 'https://github.com/Netflix/RxJava'
30+
instruction 'Import-Package', '!org.junit,!junit.framework,!org.mockito.*,*'
31+
}
32+
}
33+
34+
tasks.withType(Test) {
35+
jvmArgs "-javaagent:${configurations.quasar.iterator().next()}" // =vdmc (verbose, debug, allow monitors, check class)
36+
}
37+
38+
tasks.withType(JavaExec) {
39+
jvmArgs "-javaagent:${configurations.quasar.iterator().next()}" // =vdmc (verbose, debug, allow monitors, check class)
40+
}

0 commit comments

Comments
 (0)