// Path: 2016-07-06_rxjava_tips/src/main/java/com/gdgand/rxjava/tips/example/more/SafeObservable.java
// public class SafeObservable<T> extends Observable<T> {
//     protected SafeObservable(OnSubscribe<T> f) {
//         super(f);
//     }
// 
//     public Subscription safeSubscribe(Subscriber<T> subscriber) {
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// 
//     public Subscription safeSubscribe(final Action1<? super T> onNext) {
//         Action1<Throwable> onError = InternalObservableUtils.ERROR_NOT_IMPLEMENTED;
//         Action0 onCompleted = Actions.empty();
//         Subscriber<T> subscriber = new ActionSubscriber<T>(onNext, onError, onCompleted);
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// 
//     public Subscription safeSubscribe(final Action1<? super T> onNext, final Action1<Throwable> onError) {
//         Action0 onCompleted = Actions.empty();
//         Subscriber<T> subscriber = new ActionSubscriber<T>(onNext, onError, onCompleted);
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// 
//     public Subscription safeSubscribe(final Action1<? super T> onNext,
//                                       final Action1<Throwable> onError, final Action0 onCompleted) {
//         Subscriber<T> subscriber = new ActionSubscriber<T>(onNext, onError, onCompleted);
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// }


import com.gdgand.rxjava.tips.example.more.SafeObservable;
import rx.Observable;
import rx.subjects.PublishSubject;
package com.gdgand.rxjava.tips.example;

// import com.fernandocejas.frodo.annotation.RxLogObservable;


public final class RxUserBus {
    private static PublishSubject<String> bus = PublishSubject.create();

    private RxUserBus() {}

    static Observable<String> sub() {
        return bus.asObservable();
    }

    // @RxLogObservable(RxLogObservable.Scope.EVERYTHING)
// Path: 2016-07-06_rxjava_tips/src/main/java/com/gdgand/rxjava/tips/example/more/SafeObservable.java
// public class SafeObservable<T> extends Observable<T> {
//     protected SafeObservable(OnSubscribe<T> f) {
//         super(f);
//     }
// 
//     public Subscription safeSubscribe(Subscriber<T> subscriber) {
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// 
//     public Subscription safeSubscribe(final Action1<? super T> onNext) {
//         Action1<Throwable> onError = InternalObservableUtils.ERROR_NOT_IMPLEMENTED;
//         Action0 onCompleted = Actions.empty();
//         Subscriber<T> subscriber = new ActionSubscriber<T>(onNext, onError, onCompleted);
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// 
//     public Subscription safeSubscribe(final Action1<? super T> onNext, final Action1<Throwable> onError) {
//         Action0 onCompleted = Actions.empty();
//         Subscriber<T> subscriber = new ActionSubscriber<T>(onNext, onError, onCompleted);
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// 
//     public Subscription safeSubscribe(final Action1<? super T> onNext,
//                                       final Action1<Throwable> onError, final Action0 onCompleted) {
//         Subscriber<T> subscriber = new ActionSubscriber<T>(onNext, onError, onCompleted);
//         WeakSubscriberDecorator<T> weakSubscriberDecorator = new WeakSubscriberDecorator<>(subscriber);
//         return subscribe(weakSubscriberDecorator);
//     }
// }


// Path: 2016-07-06_rxjava_tips/src/main/java/com/gdgand/rxjava/tips/example/RxUserBus.java
import com.gdgand.rxjava.tips.example.more.SafeObservable;
import rx.Observable;
import rx.subjects.PublishSubject;

package com.gdgand.rxjava.tips.example;

// import com.fernandocejas.frodo.annotation.RxLogObservable;


public final class RxUserBus {
    private static PublishSubject<String> bus = PublishSubject.create();

    private RxUserBus() {}

    static Observable<String> sub() {
        return bus.asObservable();
    }

    // @RxLogObservable(RxLogObservable.Scope.EVERYTHING)
    static SafeObservable<String> subSafe() {