Java Code Examples for io.reactivex.Observable.fromPublisher()

The following are Jave code examples for showing how to use fromPublisher() of the io.reactivex.Observable class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AndroidToolbox   File:   Source Code and License Vote up 5 votes
 * Converts DataBinding's ObservableField  to RxJava2's Observable
 * see
 * @param observableField
 * @param <T>
 * @return Observable (RxJava2)
public static <T> Observable<T> toObservable(@NonNull final ObservableField<T> observableField) {

    return Observable.fromPublisher(asyncEmitter -> {
        final android.databinding.Observable.OnPropertyChangedCallback callback = new android.databinding.Observable.OnPropertyChangedCallback() {
            public void onPropertyChanged(android.databinding.Observable dataBindingObservable, int propertyId) {
                if (dataBindingObservable == observableField) {
Example 2
Project: Java-EX   File:   Source Code and License Vote up 4 votes
public Observable<T> observable() {
  return Observable.fromPublisher(get());
Example 3
Project: hoard   File:   Source Code and License Vote up 2 votes
 * Same as {@link #retrieveAll()} but wrapped in a {@link Observable}.
 * @return Observable that when subscribed will retrieve the key value pairs stored in
 * {@link Hoard} and provide them as a {@link Hoard.Pair}
public Observable<Hoard.Pair> retrieveAllRx() {
  return Observable.fromPublisher(hoard.retrieveAllReactive());