com.levigo.util.concurrent.tasks
Interface TaskExecutor<R>

Type Parameters:
R - the Task's result type

public interface TaskExecutor<R>

TaskExecutors provide execution services for Tasks. A TaskExecutor deals with Tasks returning a particular type of result only. TaskExecutors are typically relatively light-weight wrappers provided by TaskServices, being merely submission receptacles for tasks, so that they can be created wherever some kind of asynchronous execution of a particular kind of task is needed.


Method Summary
 void cancelAll()
          Cancel all pending tasks for this executor's scope.
<T extends R>
Future<T>
execute(Task<T> task)
          Execute the given Task.
 int getPriority()
          Return the priority of Tasks submitted using this executor.
 void setPriority(int priority)
          Set the priority of Tasks submitted using this executor.
 

Method Detail

execute

<T extends R> Future<T> execute(Task<T> task)
Execute the given Task.

Parameters:
task - the task
Returns:
the Future associated with the task

cancelAll

void cancelAll()
Cancel all pending tasks for this executor's scope.


getPriority

int getPriority()
Return the priority of Tasks submitted using this executor.

Returns:
the priority

setPriority

void setPriority(int priority)
Set the priority of Tasks submitted using this executor.

Parameters:
priority - the priority to set


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.