Skip to content

Commit

Permalink
Remove Ambiguous Subscribe Overloads with Scheduler
Browse files Browse the repository at this point in the history
- Fixes ReactiveX/RxJava#1116
- These should never have been added, the subscribeOn operator already provides this functionality
  • Loading branch information
benjchristensen committed May 20, 2014
1 parent a8b21a2 commit 876e936
Showing 1 changed file with 0 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,6 @@ trait Observable[+T]
asJavaObservable.subscribe()
}

/**
* $subscribeObserverMain
*
* @param observer $subscribeObserverParamObserver
* @param scheduler $subscribeObserverParamScheduler
* @return $subscribeAllReturn
*/
def subscribe(observer: Observer[T], scheduler: Scheduler): Subscription = {
asJavaObservable.subscribe(observer.asJavaObserver, scheduler)
}

/**
* $subscribeObserverMain
*
Expand All @@ -147,19 +136,6 @@ trait Observable[+T]
*/
def apply(observer: Observer[T]): Subscription = subscribe(observer)

/**
* $subscribeSubscriberMain
*
* @param subscriber $subscribeSubscriberParamObserver
* @param scheduler $subscribeSubscriberParamScheduler
* @return $subscribeAllReturn
*/
def subscribe(subscriber: Subscriber[T], scheduler: Scheduler): Subscription = {
// Add the casting to avoid compile error "ambiguous reference to overloaded definition"
val thisJava = asJavaObservable.asInstanceOf[rx.Observable[T]]
thisJava.subscribe(subscriber.asJavaSubscriber, scheduler)
}

/**
* $subscribeSubscriberMain
*
Expand Down Expand Up @@ -220,48 +196,6 @@ trait Observable[+T]
)
}

/**
* $subscribeCallbacksMainWithNotifications
*
* @param onNext $subscribeCallbacksParamOnNext
* @param onError $subscribeCallbacksParamOnError
* @param onCompleted $subscribeCallbacksParamOnComplete
* @param scheduler $subscribeCallbacksParamScheduler
* @return $subscribeAllReturn
*/
def subscribe(onNext: T => Unit, onError: Throwable => Unit, onCompleted: () => Unit, scheduler: Scheduler): Subscription = {
asJavaObservable.subscribe(scalaFunction1ProducingUnitToAction1(onNext),
scalaFunction1ProducingUnitToAction1(onError),
scalaFunction0ProducingUnitToAction0(onCompleted),
scheduler)
}

/**
* $subscribeCallbacksMainWithNotifications
*
* @param onNext $subscribeCallbacksParamOnNext
* @param onError $subscribeCallbacksParamOnError
* @param scheduler $subscribeCallbacksParamScheduler
* @return $subscribeAllReturn
*/
def subscribe(onNext: T => Unit, onError: Throwable => Unit, scheduler: Scheduler): Subscription = {
asJavaObservable.subscribe(
scalaFunction1ProducingUnitToAction1(onNext),
scalaFunction1ProducingUnitToAction1(onError),
scheduler)
}

/**
* $subscribeCallbacksMainNoNotifications
*
* @param onNext $subscribeCallbacksParamOnNext
* @param scheduler $subscribeCallbacksParamScheduler
* @return $subscribeAllReturn
*/
def subscribe(onNext: T => Unit, scheduler: Scheduler): Subscription = {
asJavaObservable.subscribe(scalaFunction1ProducingUnitToAction1(onNext), scheduler)
}

/**
* Returns a pair of a start function and an [[rx.lang.scala.Observable]] that upon calling the start function causes the source Observable to
* push results into the specified subject.
Expand Down

0 comments on commit 876e936

Please sign in to comment.