Package ai.djl.serving.wlm
Class WorkerThread.Builder<I,O>
java.lang.Object
ai.djl.serving.wlm.WorkerThread.Builder<I,O>
- Enclosing class:
- WorkerThread<I,
O>
A Builder to construct a
WorkerThread
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theWorkerThread
with the provided data.optFixPoolThread
(boolean fixPoolThread) Sets if the workerThread should be part of the fixed pool.setDevice
(ai.djl.Device device) RSets the device to run operations on.setJobQueue
(LinkedBlockingDeque<WorkerJob<I, O>> jobQueue) Sets the jobQueue used to poll for new jobs.
-
Method Details
-
setDevice
RSets the device to run operations on.- Parameters:
device
- the device to run operations on- Returns:
- self-reference to this builder
-
setJobQueue
Sets the jobQueue used to poll for new jobs.- Parameters:
jobQueue
- the jobQueue to set- Returns:
- self-reference to this builder.
-
optFixPoolThread
Sets if the workerThread should be part of the fixed pool. Fixed Pool workers don't terminate themself but are managed by WorkLoadManager min/max-worker scale functionality.- Parameters:
fixPoolThread
- the fixPoolThread to set- Returns:
- self-reference to this builder.
-
build
Builds theWorkerThread
with the provided data.- Returns:
- an
WorkerThread
-