package io.trygvis.queue; /** * TODO: Implement waitForSuccess(). Rename waitFor to waitForAny(). Let waitForAny() throw TargetInvocationException * which contains the exception that the task threw. */ public class TaskRef { private Task task; public TaskRef(Task task) { this.task = task; } public Task getTask() { return task; } public void waitFor(int timeout) throws InterruptedException { synchronized (this) { wait(timeout); } } }