@Test(expected = IllegalStateException.class) public void shouldFailToSubmitTwoTimesTheSameTask() { setUpAwex(); VoidTask someTask = new VoidTask() { @Override protected void runWithoutResult() throws InterruptedException { } }; mAwex.submit(someTask); mAwex.submit(someTask); }
public <Result, Progress> Promise<Result, Progress> submit(final Task<Result, Progress> task) { task.initialize(this); PoolStateImpl poolState = extractPoolState(); mPoolPolicy.onTaskAdded(poolState, task); poolState.recycle(); return task.getPromise(); }
Awex { public <Result, Progress> Promise<Result, Progress> submit(final Task<Result, Progress> task) { task.initialize(this); PoolStateImpl poolState = extractPoolState(); mPoolPolicy.onTaskAdded(poolState, task); poolState.recycle(); return task.getPromise(); } }
Awex { public <Result, Progress> Promise<Result, Progress> submit(final Task<Result, Progress> task) { task.initialize(this); PoolStateImpl poolState = extractPoolState(); mPoolPolicy.onTaskAdded(poolState, task); poolState.recycle(); return task.getPromise(); } Awex(ThreadHelper threadHelper, Logger logger, PoolPolicy poolPolicy); }
Awex { public <Result, Progress> Promise<Result, Progress> submit(final Task<Result, Progress> task) { task.initialize(this); PoolStateImpl poolState = extractPoolState(); mPoolPolicy.onTaskAdded(poolState, task); poolState.recycle(); return task.getPromise(); } Awex(ThreadHelper threadHelper, Logger logger, PoolPolicy poolPolicy); Promise<Result, Progress> submit(final Task<Result, Progress> task); void cancel(Task<Result, Progress> task, boolean mayInterrupt); @SafeVarargs final Promise<Result, Progress> sequentiallyUntilFirstDone(final
    Task<Result, Progress>... tasks); Promise<Result, Progress> sequentiallyUntilFirstDone(final
    Collection<Task<Result, Progress>> tasks); @SafeVarargs final Promise<Collection<Result>, Progress> allOf(Promise<Result, Progress>... promises); Promise<Collection<Result>, Progress> allOf(Collection<Promise<Result, Progress>> promises); @SafeVarargs final Promise<Result, Progress> anyOf(Promise<Result, Progress>... promises); Promise<Result, Progress> anyOf(Collection<Promise<Result, Progress>> promises); @SafeVarargs final Promise<MultipleResult<Result, Progress>, Progress> afterAll(Promise<Result, Progress>... promises); Promise<MultipleResult<Result, Progress>, Progress> afterAll(Collection<Promise<Result, Progress>> promises); @SuppressWarnings("unchecked") Promise<Result, Progress> of(Result value); ResolvablePromise<Result, Progress> newAwexPromise(); @SuppressWarnings("unchecked") Promise<Result, Progress> absent(); @Override String toString(); }
Awex { public <Result, Progress> Promise<Result, Progress> submit(final Task<Result, Progress> task) { task.initialize(this); PoolStateImpl poolState = extractPoolState(); mPoolPolicy.onTaskAdded(poolState, task); poolState.recycle(); return task.getPromise(); } Awex(ThreadHelper threadHelper, Logger logger, PoolPolicy poolPolicy); Promise<Result, Progress> submit(final Task<Result, Progress> task); void cancel(Task<Result, Progress> task, boolean mayInterrupt); @SafeVarargs final Promise<Result, Progress> sequentiallyUntilFirstDone(final
    Task<Result, Progress>... tasks); Promise<Result, Progress> sequentiallyUntilFirstDone(final
    Collection<Task<Result, Progress>> tasks); @SafeVarargs final Promise<Collection<Result>, Progress> allOf(Promise<Result, Progress>... promises); Promise<Collection<Result>, Progress> allOf(Collection<Promise<Result, Progress>> promises); @SafeVarargs final Promise<Result, Progress> anyOf(Promise<Result, Progress>... promises); Promise<Result, Progress> anyOf(Collection<Promise<Result, Progress>> promises); @SafeVarargs final Promise<MultipleResult<Result, Progress>, Progress> afterAll(Promise<Result, Progress>... promises); Promise<MultipleResult<Result, Progress>, Progress> afterAll(Collection<Promise<Result, Progress>> promises); @SuppressWarnings("unchecked") Promise<Result, Progress> of(Result value); ResolvablePromise<Result, Progress> newAwexPromise(); @SuppressWarnings("unchecked") Promise<Result, Progress> absent(); @Override String toString();  }