Interface ILspTaskExecutor


public interface ILspTaskExecutor
Interface for a class that can schedule and execute tasks. Tasks are submitted in the form of Runnable objects and are typically executed in an asynchronous fashion. Tasks can be monitored by registering a listener.
Since:
2012.0
  • Method Details

    • execute

      Future execute(TLspTaskExecutorRunnable aTaskExecutorRunnable)
      Schedules the supplied Runnable for execution. The actual execution may take place at some unspecified point in the future. This method therefore returns a Future which can be used to query the progress of the task. A return value of null indicates that the task was already executed when this method returned.
      Parameters:
      aTaskExecutorRunnable - the task to be executed
      Returns:
      a Future for following up on the task
    • flush

      void flush()
      Blocks until all currently pending tasks have finished.
    • abort

      void abort()
      Attempts to cancel all currently pending tasks and blocks until the task queue is empty.
    • destroy

      void destroy()
      Calls abort() and renders the task executor invalid to use.
    • addTaskListener

      void addTaskListener(ILspTaskExecutorListener aTaskExecutorListener)
      Adds a task listener to this task executor. The task listener will be notified of any changes in tasks.
      Parameters:
      aTaskExecutorListener - a task executor listener that will be notified of task updates
    • removeTaskListener

      void removeTaskListener(ILspTaskExecutorListener aTaskExecutorListener)
      Removes a task listener from this task executor. The task listener will no longer be notified of any changes in tasks.
      Parameters:
      aTaskExecutorListener - a task executor listener that will no longer be notified of task updates