Lines Matching defs:task
68 /** Encapsulates an async task with the params and identifier it was submitted with. */
125 AsyncTask<T, ?, ?> task, T... params) {
130 Assert.assertNotNull("Already had a valid task.\n"
132 + "onPreExecute() method of another task being submitted?\n"
133 + "Sorry! Not that's not supported.", task);
134 mNextTask = task;
136 return task.executeOnExecutor(this, params);
141 public <T> AsyncTask<T, ?, ?> submit(Object identifier, AsyncTask<T, ?, ?> task, T... params) {
143 return mBlockingExecutor.submit(identifier, task, params);
147 * Runs a single task matching the given identifier.
149 * Removes the matching task from the list of submitted tasks, then runs it. The executor used
150 * to execute this async task will be a same-thread executor.
152 * Fails if there was not exactly one task matching the given identifier.
158 Assert.assertEquals("Expected one task " + identifier + ", got " + tasks, 1, tasks.size());
175 for (SubmittedTask task : tasks) {
176 runTask(task);
183 * Blocks until the task has completed running.
212 SubmittedTask task = iter.next();
213 if (identifier.equals(task.getIdentifier())) {
214 results.add(task);