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

com.stanfy.enroscar.async.Async Maven / Gradle / Ivy

Go to download

Helper classes and extended abstractions for Android loaders, content resolvers, and DB access.

There is a newer version: 2.1
Show newest version
package com.stanfy.enroscar.async;

/**
 * Represents some asynchronous operation that can observed and/or canceled.
 * It's a bit similar to {@link java.util.concurrent.Future}. But instead of {@code get()} it has
 * {@link #subscribe(AsyncObserver)}.
 * After {@link #cancel()} is called observer methods won't be called.
 *
 * 

* Asynchronous operation that provides the result is triggered (meaning actually executed) * not sooner than the first {@link #subscribe(AsyncObserver)} call is performed. * If {@link #cancel()} is called before the first {@link #subscribe(AsyncObserver)} invocation, * the operations is never executed, and {@code subscribe()} is no-op. *

* *

* Implementations should not keep strong references to {@code Activity}s since they can be * retained during Activity recreation. *

* * @param data type * @author Roman Mazur - Stanfy (http://stanfy.com) */ public interface Async { void subscribe(AsyncObserver observer); void cancel(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy