So I'm pretty new to both Scala and RX. The guy who knew the most, and who actually wrote this code, just left, and I'm not sure what's going on. This construct is all over his code and I'm not really clear what its doing:
def foo(List[Long]) : Observable[Unit] =
Observable {
subscriber => {
do some stuff
subscriber.onNext()
subscriber.onCompleted()
}
I mostly get do some stuff
, and the calls to subscriber. What I don't get is, where does subscriber
come from? Does subscriber => {
instantiate the subscriber? What does Observable { subscriber => { ... } }
do/mean?