Class DefaultConsumerWorkerFactory<InputT,MetricsT>

java.lang.Object
io.aleph0.yap.core.worker.DefaultConsumerWorkerFactory<InputT,MetricsT>
Type Parameters:
InputT - the type of the input
MetricsT - the type of the metrics
All Implemented Interfaces:
Measureable<MetricsT>, ConsumerWorkerFactory<InputT,MetricsT>

public class DefaultConsumerWorkerFactory<InputT,MetricsT> extends Object implements ConsumerWorkerFactory<InputT,MetricsT>
A ConsumerWorkerFactory that creates and manages multiple MeasuredConsumerWorkers and tracks their metrics.

This factory uses a BinaryOperator to aggregate the metrics of all active workers. If there are no active workers, the metrics will be null. If there is one active worker, the metrics will be the metrics of that worker. If there are multiple active workers, the metrics will be the result of applying the BinaryOperator to the metrics of all active workers.