Package com.github.workerframework.api
Interface BulkWorkerRuntime
public interface BulkWorkerRuntime
This object is supplied to CAF Workers which are able to process multiple tasks together. It allows them to request additional tasks.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves another task to be processed.getNextWorkerTask
(long millis) Retrieves another task to be processed.
-
Method Details
-
getNextWorkerTask
WorkerTask getNextWorkerTask()Retrieves another task to be processed. This method does not block; if a task is not readily available then null is returned immediately.- Returns:
- the next task to be processed or null if a task is not readily available
-
getNextWorkerTask
Retrieves another task to be processed. If a task is not readily available then this method will block waiting for a task for the specified number of milliseconds, after which it will return null if a task is still not available.- Parameters:
millis
- the maximum number of milliseconds to wait on a task- Returns:
- the next task to be processed or null if a task is not available
- Throws:
InterruptedException
- if the thread is interrupted while blocking
-