T
- caller specific context datapublic interface WorkerWorkload<T>
Modifier and Type | Method and Description |
---|---|
T |
doWork(T context,
int batchSize,
Measurement<T> measurement)
Perform a batch of work units.
|
void |
finishWork(Measurement<T> measurement)
Notify the worker that the @link{doWork} method will not be called again on the current thread (but it may
still be called from other threads).
|
T doWork(T context, int batchSize, Measurement<T> measurement)
context
- a thread specific instance that may have been returned by a previous invocation of the doWork
method by this thread. This may be useful if the worker needs to save thread specific data
for use by later invocations on the same threadbatchSize
- the number of work iterations to perform in this batchmeasurement
- config parameters for the work that triggered this callvoid finishWork(Measurement<T> measurement)
measurement
- config parameters for the work that triggered this call - each worker thread gets its own copy
of the config. NB: Any context object associated with the last call to the @link{doWork} call is
available by calling @link{measurement.getContext} on this parameter.Copyright © 2021 JBoss by Red Hat. All rights reserved.