Skip to content

Commit 750fa92

Browse files
Merge branch 'master' of github.com:Netflix/RxJava into scalaadaptor
2 parents 60b9785 + 8e44bcb commit 750fa92

File tree

22 files changed

+1754
-89
lines changed

22 files changed

+1754
-89
lines changed

CHANGES.md

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

3+
### Version 0.14.6 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.14.6%22)) ###
4+
5+
* [Pull 441](https://github.com/Netflix/RxJava/pull/441) Fixed the issue that 'take' does not call 'onError'
6+
* [Pull 443](https://github.com/Netflix/RxJava/pull/443) OperationSwitch notify onComplete() too early.
7+
* [Pull 434](https://github.com/Netflix/RxJava/pull/434) Timeout operator and SerialSubscription
8+
* [Pull 447](https://github.com/Netflix/RxJava/pull/447) Caching the result of 'isInternalImplementation'
9+
10+
### Version 0.14.5 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.14.5%22)) ###
11+
12+
* [Pull 438](https://github.com/Netflix/RxJava/pull/438) Kotlin Language Adaptor
13+
14+
### Version 0.14.4 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.14.4%22)) ###
15+
16+
* [Issue 428](https://github.com/Netflix/RxJava/issues/428) Fix: buffer() using TimeAndSizeBasedChunks incorrectly forces thread into interrupted state
17+
* [Pull 435](https://github.com/Netflix/RxJava/pull/435) rx-apache-http recognizes "Transfer-Encoding: chunked" as an HTTP stream
18+
* [Pull 437](https://github.com/Netflix/RxJava/pull/437) Fixes: Scheduler and Merge
19+
20+
321
### Version 0.14.3 ([Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.rxjava%22%20AND%20v%3A%220.14.3%22)) ###
422

523
* [Pull 407](https://github.com/Netflix/RxJava/pull/407) Operator: RefCount

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=0.14.4-SNAPSHOT
1+
version=0.14.7-SNAPSHOT
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Kotlin Adaptor for RxJava
2+
3+
Kotlin has support for SAM (Single Abstract Method) Interfaces as Functions (i.e. Java 8 Lambdas). So you could use Kotlin in RxJava whitout this adaptor
4+
5+
```kotlin
6+
Observable.create<String>{ observer ->
7+
observer!!.onNext("Hello")
8+
observer.onCompleted()
9+
Subscriptions.empty()
10+
}!!.subscribe { result ->
11+
a!!.received(result)
12+
}
13+
```
14+
15+
This adaptor exposes a set of Extension functions that allow a more idiomatic Kotlin usage
16+
17+
```kotlin
18+
import rx.lang.kotlin.*
19+
20+
{(observer: Observer<in String>) ->
21+
observer.onNext("Hello")
22+
observer.onCompleted()
23+
Subscriptions.empty()!!
24+
}.asObservable().subscribe { result ->
25+
a!!.received(result)
26+
}
27+
```
28+
29+
## Binaries
30+
31+
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%7Ca%3A%22rxjava-kotlin%22).
32+
33+
Example for Maven:
34+
35+
```xml
36+
<dependency>
37+
<groupId>com.netflix.rxjava</groupId>
38+
<artifactId>rxjava-kotlin</artifactId>
39+
<version>x.y.z</version>
40+
</dependency>
41+
```
42+
43+
and for Ivy:
44+
45+
```xml
46+
<dependency org="com.netflix.rxjava" name="rxjava-kotlin" rev="x.y.z" />
47+
```
48+
49+
and for Gradle:
50+
51+
```groovy
52+
compile 'com.netflix.rxjava:rxjava-kotlin:x.y.z'
53+
```
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
buildscript {
2+
repositories() {
3+
mavenCentral()
4+
}
5+
6+
dependencies {
7+
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.6.800'
8+
}
9+
}
10+
11+
apply plugin: 'kotlin'
12+
apply plugin: 'osgi'
13+
14+
dependencies {
15+
compile project(':rxjava-core')
16+
compile 'org.jetbrains.kotlin:kotlin-stdlib:0.6.800'
17+
provided 'junit:junit-dep:4.10'
18+
provided 'org.mockito:mockito-core:1.8.5'
19+
}
20+
21+
jar {
22+
manifest {
23+
name = 'rxjava-kotlin'
24+
instruction 'Bundle-Vendor', 'Netflix'
25+
instruction 'Bundle-DocURL', 'https://github.com/Netflix/RxJava'
26+
instruction 'Import-Package', '!org.junit,!junit.framework,!org.mockito.*,*'
27+
instruction 'Fragment-Host', 'com.netflix.rxjava.core'
28+
}
29+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* Copyright 2013 Netflix, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package rx.lang.kotlin
18+
19+
import rx.Subscription
20+
import rx.Observer
21+
import rx.Observable
22+
23+
public fun<T> Function1<Observer<in T>, Subscription>.asObservable(): Observable<T> {
24+
return Observable.create { this(it!!) }!!
25+
}
26+
27+
public fun<T> Function0<Observable<out T>>.defer(): Observable<T> {
28+
return Observable.defer(this)!!
29+
}
30+
31+
public fun<T> Iterable<T>.asObservable(): Observable<T> {
32+
return Observable.from(this)!!
33+
}
34+
35+
public fun<T> T.asObservable(): Observable<T> {
36+
return Observable.from(this)!!
37+
}
38+
39+
public fun<T> Throwable.asObservable(): Observable<T> {
40+
return Observable.error(this)!!
41+
}
42+
43+
public fun<T> Pair<T, T>.asObservable(): Observable<T> {
44+
return Observable.from(this.component1(), this.component2())!!
45+
}
46+
47+
public fun<T> Triple<T, T, T>.asObservable(): Observable<T> {
48+
return Observable.from(this.component1(), this.component2(), this.component3())!!
49+
}
50+
51+
public fun<T> Pair<Observable<T>, Observable<T>>.merge(): Observable<T> {
52+
return Observable.merge(this.component1(), this.component2())!!
53+
}
54+
55+
public fun<T> Triple<Observable<T>, Observable<T>, Observable<T>>.merge(): Observable<T> {
56+
return Observable.merge(this.component1(), this.component2(), this.component3())!!
57+
}
58+
59+
public fun<T> Pair<Observable<T>, Observable<T>>.mergeDelayError(): Observable<T> {
60+
return Observable.mergeDelayError(this.component1(), this.component2())!!
61+
}
62+
63+
public fun<T> Triple<Observable<T>, Observable<T>, Observable<T>>.mergeDelayError(): Observable<T> {
64+
return Observable.mergeDelayError(this.component1(), this.component2(), this.component3())!!
65+
}

0 commit comments

Comments
 (0)