Class Worker

java.lang.Object
org.eclipse.compare.internal.Worker
All Implemented Interfaces:
IRunnableWithProgress

public class Worker extends Object implements IRunnableWithProgress
A worker performs a set of tasks in order and accumulates any errors that may have occurred. If the same task is queued multiple times, the last occurrence will be run. If a task is queued while it is running, the running task will be canceled and the task added to the end of the work queue.
  • Constructor Details

    • Worker

      public Worker(String taskName)
  • Method Details

    • run

      public void run(IProgressMonitor monitor)
      Description copied from interface: IRunnableWithProgress
      Runs this operation. Progress should be reported to the given progress monitor. This method is usually invoked by an IRunnableContext's run method, which supplies the progress monitor. A request to cancel the operation should be honored and acknowledged by throwing InterruptedException.
      Specified by:
      run in interface IRunnableWithProgress
      Parameters:
      monitor - the progress monitor to use to display progress and receive requests for cancelation
      See Also:
    • getErrors

      public Throwable[] getErrors()
    • getTaskName

      protected String getTaskName()
    • add

      public void add(IRunnableWithProgress r)
    • isWorking

      public boolean isWorking()
    • hasWork

      public boolean hasWork()