public static <R> LocalifyCallback<R> subscribe(final Executor executor, Observable<R> observable, final LocalifyCallback<R> callback) {
        observable
                .subscribe(
                        new Action1<R>() {
                            @Override
                            public void call(final R r) {
                                executor.execute(new Runnable() {
                                    @Override
                                    public void run() {
                                        callback.onSuccess(r);
                                    }
                                });
                            }
                        },
                        new Action1<Throwable>() {
                            @Override
                            public void call(final Throwable throwable) {
                                executor.execute(new Runnable() {
                                    @Override
                                    public void run() {
                                        callback.onError(throwable);
                                    }
                                });
                            }
                        });

        return callback;
    }
public static < R > LocalifyCallback < R > subscribe ( final Executor executor , Observable < R > observable , final LocalifyCallback < R > callback ) { observable . subscribe ( new Action1 < R > ( ) { @ Override public void call ( final R r ) { executor . execute ( new Runnable ( ) { @ Override public void run ( ) { callback . onSuccess ( r ) ; } } ) ; } } , new Action1 < Throwable > ( ) { @ Override public void call ( final Throwable throwable ) { executor . execute ( new Runnable ( ) { @ Override public void run ( ) { callback . onError ( throwable ) ; } } ) ; } } ) ; return callback ; }
@param executor
@param observable
@param callback
@param <R>
@return