Package ai.djl.serving.wlm
Class WorkerPoolConfig.ThreadConfig<I,O>
- java.lang.Object
-
- ai.djl.serving.wlm.WorkerPoolConfig.ThreadConfig<I,O>
-
- Type Parameters:
I
- the input typeO
- the output type
- Direct Known Subclasses:
ModelInfo.ModelThread
- Enclosing class:
- WorkerPoolConfig<I,O>
public abstract static class WorkerPoolConfig.ThreadConfig<I,O> extends java.lang.Object
The part of theWorkerPoolConfig
for an individualWorkerThread
.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.LinkedBlockingDeque<Job<I,O>>
configJobs
-
Constructor Summary
Constructors Modifier Constructor Description protected
ThreadConfig(ai.djl.Device device)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close()
Closes the thread type and frees any resources.java.util.concurrent.LinkedBlockingDeque<Job<I,O>>
getConfigJobs()
Gets the configuration jobs for the worker.abstract void
run(java.util.List<Job<I,O>> inputs)
Runs the work on theWorkerThread
and stores in the job.
-
-
-
Method Detail
-
run
public abstract void run(java.util.List<Job<I,O>> inputs) throws ai.djl.translate.TranslateException
Runs the work on theWorkerThread
and stores in the job.- Parameters:
inputs
- the work input- Throws:
ai.djl.translate.TranslateException
- if it failed to compute
-
getConfigJobs
public java.util.concurrent.LinkedBlockingDeque<Job<I,O>> getConfigJobs()
Gets the configuration jobs for the worker.- Returns:
- the configuration jobs for the worker
-
close
public abstract void close()
Closes the thread type and frees any resources.
-
-