Skip to content

Commit 0384095

Browse files
Merge pull request #396 from samuelgruetter/idiomaticscala
Add missing methods to Scala Adaptor
2 parents 9ec8b0e + a2ab731 commit 0384095

File tree

6 files changed

+1000
-278
lines changed

6 files changed

+1000
-278
lines changed

language-adaptors/rxjava-scala/TODO.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ TODOs for Scala Adapter
44

55
This is a (probably incomplete) list of what still needs to be done in the Scala adaptor:
66

7-
- [ ] ConnectableObservable: Implement adaptor. Note that it cannot extend Scala Observable, since value classes are final.
8-
- [ ] more methods of BlockingObservable
9-
- [ ] multicast, publish, replay once we have ConnectableObservable
10-
- [ ] groupBy and GroupedObservable
11-
- [ ] mirror complete Java package structure in Scala
12-
- [ ] convert Java futures to Scala futures
13-
- [ ] Add methods present in Scala collections library, but not in RxJava, e.g. zipWithIndex, aggregate à la Scala
14-
- [ ] mergeDelayError, combineLatest, merge, concat, zip: decide if instance method or static or both, decide about arities > 2
15-
- [ ] naming: switch() or switchOnNext()?
16-
- [ ] decide where the MovieLib/MovieLibUsage (use Scala code from Java code) example should live and make sure gradle builds it in the right order
17-
- [ ] Avoid text duplication in scaladoc using templates, add examples, distinction between use case signature and full signature
18-
- [ ] other small TODOs
7+
* mirror complete Java package structure in Scala
8+
* objects for classes with static methods or singletons (e.g. Schedulers, Subscriptions)
9+
* Notification as a case class
10+
* integrating Scala Futures, should there be a common base interface for Futures and Observables?
11+
* Add methods present in Scala collections library, but not in RxJava, e.g. aggregate à la Scala, collect, exists, tails, ...
12+
* combineLatest with arities > 2
13+
* decide where the MovieLib/MovieLibUsage (use Scala code from Java code) example should live and make sure gradle builds it in the right order
14+
* Avoid text duplication in scaladoc using templates, add examples, distinction between use case signature and full signature
15+
* other small TODOs
1916

2017

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/ImplicitFunctionConversions.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ object ImplicitFunctionConversions {
7373
new Func2[A, B, jlang.Boolean] {
7474
def call(a: A, b: B): jlang.Boolean = f(a, b).booleanValue
7575
}
76+
77+
implicit def scalaFuncNToRxFuncN[R](f: Seq[java.lang.Object] => R): FuncN[R] =
78+
new FuncN[R] {
79+
def call(args: java.lang.Object*): R = f(args)
80+
}
7681

7782
/**
7883
* Converts a specific function shape (used in takeWhile) to the equivalent Java types with an Rx Func2

0 commit comments

Comments
 (0)