All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pushtorefresh.storio.operations.PreparedOperation Maven / Gradle / Ivy

There is a newer version: 1.13.0
Show newest version
package com.pushtorefresh.storio.operations;

import android.support.annotation.NonNull;
import android.support.annotation.WorkerThread;

import rx.Observable;

/**
 * Common API of all prepared operations
 *
 * @param  type of result
 */
public interface PreparedOperation {

    /**
     * Executes operation synchronously in current thread.
     * 

* Notice: Blocking I/O operation should not be executed on the Main Thread, * it can cause ANR (Activity Not Responding dialog), block the UI and drop animations frames. * So please, execute blocking I/O operation only from background thread. * See {@link WorkerThread}. * * @return non-null result of operation. */ @NonNull @WorkerThread Result executeAsBlocking(); /** * Creates {@link rx.Observable} that emits result of Operation. *

* Observable may be "Hot" or "Cold", please read documentation of the concrete implementation. * * @return observable result of operation with only one {@link rx.Observer#onNext(Object)} call. */ @NonNull Observable createObservable(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy