@@ -1569,14 +1569,12 @@ public final void onNext(T args) {
1569
1569
* @param subscriber
1570
1570
* the Subscriber that will handle the emission or notification from the Single
1571
1571
*/
1572
- public final void unsafeSubscribe (Subscriber <? super T > subscriber ) {
1572
+ public final Subscription unsafeSubscribe (Subscriber <? super T > subscriber ) {
1573
1573
try {
1574
1574
// new Subscriber so onStart it
1575
1575
subscriber .onStart ();
1576
- // TODO add back the hook
1577
- // hook.onSubscribeStart(this, onSubscribe).call(subscriber);
1578
- onSubscribe .call (subscriber );
1579
- hook .onSubscribeReturn (subscriber );
1576
+ hook .onSubscribeStart (this , onSubscribe ).call (subscriber );
1577
+ return hook .onSubscribeReturn (subscriber );
1580
1578
} catch (Throwable e ) {
1581
1579
// special handling for certain Throwable/Error/Exception types
1582
1580
Exceptions .throwIfFatal (e );
@@ -1593,6 +1591,7 @@ public final void unsafeSubscribe(Subscriber<? super T> subscriber) {
1593
1591
// TODO why aren't we throwing the hook's return value.
1594
1592
throw r ;
1595
1593
}
1594
+ return Subscriptions .unsubscribed ();
1596
1595
}
1597
1596
}
1598
1597
@@ -1660,9 +1659,7 @@ public final Subscription subscribe(Subscriber<? super T> subscriber) {
1660
1659
// The code below is exactly the same an unsafeSubscribe but not used because it would add a sigificent depth to alreay huge call stacks.
1661
1660
try {
1662
1661
// allow the hook to intercept and/or decorate
1663
- // TODO add back the hook
1664
- // hook.onSubscribeStart(this, onSubscribe).call(subscriber);
1665
- onSubscribe .call (subscriber );
1662
+ hook .onSubscribeStart (this , onSubscribe ).call (subscriber );
1666
1663
return hook .onSubscribeReturn (subscriber );
1667
1664
} catch (Throwable e ) {
1668
1665
// special handling for certain Throwable/Error/Exception types
0 commit comments