Use AndroidExecutor for background tasks that make API calls.

This commit is contained in:
akwizgran
2016-04-29 12:18:40 +01:00
parent cb8bfeb2ce
commit c21854fbe4
10 changed files with 107 additions and 71 deletions

View File

@@ -10,11 +10,13 @@ import java.util.concurrent.Future;
public interface AndroidExecutor {
/**
* Runs the given task on the main UI thread and returns a Future for
* getting the result.
* Runs the given task on a background thread with a message queue and
* returns a Future for getting the result.
*/
<V> Future<V> submit(Callable<V> c);
/** Runs the given task on the main UI thread. */
/**
* Runs the given task on a background thread with a message queue.
*/
void execute(Runnable r);
}