Skip to content

Commit 51db3d9

Browse files
author
Joachim Hofer
committed
Pulled in all the changes from master that happened in the meantime...
2 parents ff73120 + 9cef1bd commit 51db3d9

File tree

155 files changed

+11083
-7253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+11083
-7253
lines changed

CHANGES.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,157 @@
11
# RxJava Releases #
22

3+
### Version 0.12.0 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.12.0%22)) ###
4+
5+
This version adds to the static typing changes in 0.11 and adds covariant/contravariant typing via super/extends generics.
6+
7+
Additional cleanup was done, particularly related to `BlockingObservable`. Also the `window` operator was added.
8+
9+
The largest breaking change is that `Observable.create` now accepts an `OnSubscribeFunc` rather than a `Func1`.
10+
11+
This means that instead of this:
12+
13+
```java
14+
public static <T> Observable<T> create(Func1<? super Observer<? super T>, ? extends Subscription> func)
15+
```
16+
17+
it is now:
18+
19+
```java
20+
public static <T> Observable<T> create(OnSubscribeFunc<T> func)
21+
```
22+
23+
This was done to simplify the usage of `Observable.create` which was already verbose but made far worse by the `? super` generics.
24+
25+
For example, instead of writing this:
26+
27+
```java
28+
Observable.create(new Func1<Observer<? super SomeType>, Subscription>() {
29+
/// body here
30+
}
31+
```
32+
33+
it is now written as:
34+
35+
```java
36+
Observable.create(new OnSubscribeFunc<SomeType>() {
37+
/// body here
38+
}
39+
```
40+
41+
* [Pull 343](https://github.com/Netflix/RxJava/pull/343) Covariant Support with super/extends and `OnSubscribeFunc` as type for `Observable.create`
42+
* [Pull 337](https://github.com/Netflix/RxJava/pull/337) Operator: `window`
43+
* [Pull 348](https://github.com/Netflix/RxJava/pull/348) Rename `switchDo` to `switchOnNext` (deprecate `switchDo` for eventual deletion)
44+
* [Pull 348](https://github.com/Netflix/RxJava/pull/348) Delete `switchDo` instance method in preference for static
45+
* [Pull 346](https://github.com/Netflix/RxJava/pull/346) Remove duplicate static methods from `BlockingObservable`
46+
* [Pull 346](https://github.com/Netflix/RxJava/pull/346) `BlockingObservable` no longer extends from `Observable`
47+
* [Pull 345](https://github.com/Netflix/RxJava/pull/345) Remove unnecessary constructor from `Observable`
48+
49+
### Version 0.11.2 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.11.2%22)) ###
50+
51+
* [Commit ccf53e8]( https://github.com/Netflix/RxJava/commit/ccf53e84835d99136cce80a4c508bae787d5da45) Update to Scala 2.10.2
52+
53+
### Version 0.11.1 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.11.1%22)) ###
54+
55+
* [Pull 325](https://github.com/Netflix/RxJava/pull/325) Clojure: Preserve metadata on fn and action macros
56+
57+
### Version 0.11.0 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.11.0%22)) ###
58+
59+
This is a major refactor of rxjava-core and the language adaptors.
60+
61+
Note that there are *breaking changes* in this release. Details are below.
62+
63+
After this refactor it is expected that the API will settle down and allow us to stabilize towards a 1.0 release.
64+
65+
* [Pull 332](https://github.com/Netflix/RxJava/pull/332) Refactor Core to be Statically Typed
66+
67+
RxJava was written from the beginning to target the JVM, not any specific language.
68+
69+
As a side-effect of Java not having lambdas/clojures yet (and other considerations), Netflix used dynamic languages with it predominantly for the year of its existence prior to open sourcing.
70+
71+
To bridge the rxjava-core written in Java with the various languages a FunctionalLanguageAdaptor was registered at runtime for each language of interest.
72+
73+
To enable these language adaptors methods are overloaded with `Object` in the API since `Object` is the only super-type that works across all languages for their various implementations of lambdas and closures.
74+
75+
This downside of this has been that it breaks static typing for Java, Scala and other statically-typed languages. More can be read on this issue and discussion of the subject here: https://groups.google.com/forum/#!topic/rxjava/bVZoKSsb1-o
76+
77+
This release:
78+
79+
- removes all `Object` overload methods from rxjava-core so it is statically typed
80+
- removes dynamic FunctionalLanguageAdaptors
81+
- uses idiomatic approaches for each language adaptor
82+
- Java core is statically typed and has no knowledge of other languages
83+
- Scala uses implicits
84+
- Groovy uses an ExtensionModule
85+
- Clojure adds a new macro ([NOTE: this requires code changes](https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-clojure#basic-usage))
86+
- JRuby has been temporarily disabled (discussing new implementation at https://github.com/Netflix/RxJava/issues/320)
87+
- language supports continue to be additive
88+
- the rxjava-core will always be required and then whichever language modules are desired such as rxjava-scala, rxjava-clojure, rxjava-groovy are added to the classpath
89+
- deletes deprecated methods
90+
- deletes redundant static methods on `Observable` that cluttered the API and in some cases caused dynamic languages trouble choosing which method to invoke
91+
- deletes redundant methods on `Scheduler` that gave dynamic languages a hard time choosing which method to invoke
92+
93+
The benefits of this are:
94+
95+
1) Everything is statically typed so compile-time checks for Java, Scala, etc work correctly
96+
2) Method dispatch is now done via native Java bytecode using types rather than going via `Object` which then has to do a lookup in a map. Memoization helped with the performance but each method invocation still required looking in a map for the correct adaptor. With this approach the appropriate methods will be compiled into the `rx.Observable` class to correctly invoke the right adaptor without lookups.
97+
3) Interaction from each language should work as expected idiomatically for that language.
98+
99+
Further history on the various discussions and different attempts at solutions can be seen at https://github.com/Netflix/RxJava/pull/304, https://github.com/Netflix/RxJava/issues/204 and https://github.com/Netflix/RxJava/issues/208
100+
101+
102+
### Version 0.10.1 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.10.1%22)) ###
103+
104+
A new contrib module for Android: https://github.com/Netflix/RxJava/tree/master/rxjava-contrib/rxjava-android
105+
106+
* [Pull 318](https://github.com/Netflix/RxJava/pull/318) rxjava-android module with Android Schedulers
107+
108+
### Version 0.10.0 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.10.0%22)) ###
109+
110+
This release includes a breaking change as it changes `onError(Exception)` to `onError(Throwable)`. This decision was made via discussion at https://github.com/Netflix/RxJava/issues/296.
111+
112+
Any statically-typed `Observer` implementations with `onError(Exception)` will need to be updated to `onError(Throwable)` when moving to this version.
113+
114+
* [Pull 312](https://github.com/Netflix/RxJava/pull/312) Fix for OperatorOnErrorResumeNextViaObservable and async Resume
115+
* [Pull 314](https://github.com/Netflix/RxJava/pull/314) Map Error Handling
116+
* [Pull 315](https://github.com/Netflix/RxJava/pull/315) Change onError(Exception) to onError(Throwable) - Issue #296
117+
118+
### Version 0.9.2 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.9.2%22)) ###
119+
120+
* [Pull 308](https://github.com/Netflix/RxJava/pull/308) Ensure now() is always updated in TestScheduler.advanceTo/By
121+
* [Pull 281](https://github.com/Netflix/RxJava/pull/281) Operator: Buffer
122+
123+
### Version 0.9.1 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.9.1%22)) ###
124+
125+
* [Pull 303](https://github.com/Netflix/RxJava/pull/303) CombineLatest
126+
* [Pull 290](https://github.com/Netflix/RxJava/pull/290) Zip overload with FuncN
127+
* [Pull 302](https://github.com/Netflix/RxJava/pull/302) NPE fix when no package on class
128+
* [Pull 284](https://github.com/Netflix/RxJava/pull/284) GroupBy fixes (items still [oustanding](https://github.com/Netflix/RxJava/issues/282))
129+
* [Pull 288](https://github.com/Netflix/RxJava/pull/288) PublishSubject concurrent modification fixes
130+
* [Issue 198](https://github.com/Netflix/RxJava/issues/198) Throw if no onError handler specified
131+
* [Issue 278](https://github.com/Netflix/RxJava/issues/278) Subscribe argument validation
132+
* Javadoc improvements and many new marble diagrams
133+
134+
### Version 0.9.0 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.9.0%22)) ###
135+
136+
This release includes breaking changes that move all blocking operators (such as `single`, `last`, `forEach`) to `BlockingObservable`.
137+
138+
This means `Observable` has only non-blocking operators on it. The blocking operators can now be accessed via `.toBlockingObservable()` or `BlockingObservable.from(observable)`.
139+
140+
Notes and link to the discussion of this change can be found at https://github.com/Netflix/RxJava/pull/272.
141+
142+
* [Pull 272](https://github.com/Netflix/RxJava/pull/272) Move blocking operators into BlockingObservable
143+
* [Pull 273](https://github.com/Netflix/RxJava/pull/273) Fix Concat (make non-blocking)
144+
* [Issue 13](https://github.com/Netflix/RxJava/issues/13) Operator: Switch
145+
* [Pull 274](https://github.com/Netflix/RxJava/pull/274) Remove SLF4J dependency (RxJava is now a single jar with no dependencies)
146+
147+
### Version 0.8.4 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.8.4%22)) ###
148+
149+
* [Pull 269](https://github.com/Netflix/RxJava/pull/269) (Really) Fix concurrency bug in ScheduledObserver
150+
151+
### Version 0.8.3 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.8.3%22)) ###
152+
153+
* [Pull 268](https://github.com/Netflix/RxJava/pull/268) Fix concurrency bug in ScheduledObserver
154+
3155
### Version 0.8.2 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.8.2%22)) ###
4156

5157
* [Issue 74](https://github.com/Netflix/RxJava/issues/74) Operator: Sample

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ Some of the goals of RxJava are:
99
- Target the JVM not a language. The first languages supported (beyond Java itself) are
1010
<a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-groovy">Groovy</a>,
1111
<a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-clojure">Clojure</a>,
12-
<a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-scala">Scala</a>
13-
and <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-jruby">JRuby</a>.
12+
and <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-scala">Scala</a>.
1413
New language adapters can be <a href="https://github.com/Netflix/RxJava/wiki/How-to-Contribute">contributed</a>.
15-
- Support Java 5 (to include Android support) and higher with an eventual goal to target a build for Java 8 with its lambda support.
14+
- Support Java 6+ (to include Android support)
1615

1716
Learn more about Rx on the <a href="https://github.com/Netflix/RxJava/wiki">Wiki Home</a> and the <a href="http://techblog.netflix.com/2013/02/rxjava-netflix-api.html">Netflix TechBlog post</a> where RxJava was introduced.
1817

@@ -53,7 +52,6 @@ Once we hit 1.0 it will follow the normal major.minor.patch semantic versioning
5352
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-groovy">Groovy Adaptor</a>
5453
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-clojure">Clojure Adaptor</a>
5554
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-scala">Scala Adaptor</a>
56-
- <a href="https://github.com/Netflix/RxJava/tree/master/language-adaptors/rxjava-jruby">JRuby Adaptor</a>
5755

5856
## Binaries
5957

build.gradle

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,73 @@
1-
ext.githubProjectName = rootProject.name
1+
ext.githubProjectName = 'RxJava'
2+
3+
apply from: file('gradle/convention.gradle')
4+
apply from: file('gradle/maven.gradle')
5+
//apply from: file('gradle/check.gradle')
6+
apply from: file('gradle/license.gradle')
7+
apply from: file('gradle/release.gradle')
28

39
buildscript {
4-
repositories { mavenCentral() }
10+
repositories {
11+
mavenLocal()
12+
mavenCentral() // maven { url 'http://jcenter.bintray.com' }
13+
}
514
apply from: file('gradle/buildscript.gradle'), to: buildscript
615
}
716

817
allprojects {
9-
repositories { mavenCentral() }
18+
repositories {
19+
mavenLocal()
20+
mavenCentral() // maven { url: 'http://jcenter.bintray.com' }
21+
}
1022
}
1123

12-
apply from: file('gradle/convention.gradle')
13-
apply from: file('gradle/maven.gradle')
14-
//apply from: file('gradle/check.gradle')
15-
apply from: file('gradle/license.gradle')
16-
apply from: file('gradle/release.gradle')
17-
1824
subprojects {
25+
apply plugin: 'java'
26+
apply plugin: 'eclipse'
27+
apply plugin: 'idea'
1928

20-
group = "com.netflix.${githubProjectName}"
29+
group = "com.netflix.rxjava"
30+
31+
// make 'examples' use the same classpath
32+
configurations {
33+
examplesCompile.extendsFrom compile
34+
examplesRuntime.extendsFrom runtime
35+
}
2136

2237
sourceSets.test.java.srcDir 'src/main/java'
2338

2439
tasks.withType(Javadoc).each {
2540
it.classpath = sourceSets.main.compileClasspath
2641
}
42+
43+
//include /src/examples folder
44+
sourceSets {
45+
examples
46+
}
47+
48+
//include 'examples' in build task
49+
tasks.build {
50+
dependsOn(examplesClasses)
51+
}
52+
53+
eclipse {
54+
classpath {
55+
// include 'provided' dependencies on the classpath
56+
plusConfigurations += configurations.provided
57+
58+
downloadSources = true
59+
downloadJavadoc = true
60+
}
61+
}
62+
63+
idea {
64+
module {
65+
// include 'provided' dependencies on the classpath
66+
scopes.PROVIDED.plus += configurations.provided
67+
}
68+
}
2769
}
2870

71+
project(':rxjava-core') {
72+
sourceSets.test.java.srcDir 'src/test/java'
73+
}

codequality/checkstyle.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
<!-- Checks for common coding problems -->
129129
<!-- See http://checkstyle.sf.net/config_coding.html -->
130130
<!-- <module name="AvoidInlineConditionals"/> -->
131-
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
132131
<module name="EmptyStatement"/>
133132
<module name="EqualsHashCode"/>
134133
<module name="HiddenField">

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.8.3
1+
version=0.12.1-SNAPSHOT

gradle/buildscript.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// Executed in context of buildscript
22
repositories {
33
// Repo in addition to maven central
4-
maven {
5-
name 'build-repo'
6-
url 'https://raw.github.com/Netflix-Skunkworks/build-repo/master/releases/' // gradle-release/gradle-release/1.0-SNAPSHOT/gradle-release-1.0-SNAPSHOT.jar
7-
}
4+
repositories { maven { url 'http://dl.bintray.com/content/netflixoss/external-gradle-plugins/' } } // For gradle-release
85
}
96
dependencies {
10-
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0'
7+
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.1'
118
classpath 'com.mapvine:gradle-cobertura-plugin:0.1'
12-
classpath 'gradle-release:gradle-release:1.0-SNAPSHOT'
9+
classpath 'gradle-release:gradle-release:1.1.5'
10+
classpath 'org.ajoberstar:gradle-git:0.5.0'
1311
}

gradle/check.gradle

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
subprojects {
2-
// Checkstyle
3-
apply plugin: 'checkstyle'
4-
tasks.withType(Checkstyle) { ignoreFailures = true }
5-
checkstyle {
6-
ignoreFailures = true // Waiting on GRADLE-2163
7-
configFile = rootProject.file('codequality/checkstyle.xml')
8-
}
2+
// Checkstyle
3+
apply plugin: 'checkstyle'
4+
checkstyle {
5+
ignoreFailures = true
6+
configFile = rootProject.file('codequality/checkstyle.xml')
7+
}
98

10-
// FindBugs
11-
apply plugin: 'findbugs'
12-
//tasks.withType(Findbugs) { reports.html.enabled true }
9+
// FindBugs
10+
apply plugin: 'findbugs'
11+
findbugs {
12+
ignoreFailures = true
13+
}
1314

14-
// PMD
15-
apply plugin: 'pmd'
16-
//tasks.withType(Pmd) { reports.html.enabled true }
15+
// PMD
16+
apply plugin: 'pmd'
17+
//tasks.withType(Pmd) { reports.html.enabled true }
1718

18-
apply plugin: 'cobertura'
19-
cobertura {
20-
sourceDirs = sourceSets.main.java.srcDirs
21-
format = 'html'
22-
includes = ['**/*.java', '**/*.groovy']
23-
excludes = []
24-
}
19+
apply plugin: 'cobertura'
20+
cobertura {
21+
sourceDirs = sourceSets.main.java.srcDirs
22+
format = 'html'
23+
includes = ['**/*.java', '**/*.groovy']
24+
excludes = []
25+
}
2526
}

0 commit comments

Comments
 (0)