Class GWorkQueue.Builder<T>
java.lang.Object
com.glitchybyte.glib.concurrent.workqueue.GWorkQueue.Builder<T>
- Type Parameters:
T- Work item type.
- Enclosing interface:
GWorkQueue<T>
GWorkQueue builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aGWorkQueueTaskready to be started.withParallelProcessing(boolean parallelProcessing) Changes if work items should be processed in parallel or sequentially.withProcessor(Consumer<T> processor) Changes the work item processor.withThreadName(String threadName) Changes the thread name.
-
Constructor Details
-
Builder
Creates aGWorkQueueTaskbuilder.- Parameters:
threadName- Thread name.processor- Work item processor.parallelProcessing- True, if work items should be processed in parallel.
-
Builder
public Builder()Creates a GWorkQueue builder with default values.
-
-
Method Details
-
withThreadName
Changes the thread name.- Parameters:
threadName- Thread name.- Returns:
- A new builder with updated values.
-
withProcessor
Changes the work item processor.- Parameters:
processor- Work item processor.- Returns:
- A new builder with updated values.
-
withParallelProcessing
Changes if work items should be processed in parallel or sequentially.- Parameters:
parallelProcessing- True, if work items should be processed in parallel.- Returns:
- A new builder with updated values.
-
build
Builds aGWorkQueueTaskready to be started.- Returns:
- A
GWorkQueueTaskready to be started.
-