blob: 597baac2bdbe2b6f55c0944b908395d3d0766c97 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package org.openecomp.sdc.dmaap;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class RequestManager {
private Executor executor;
public RequestManager(int poolSize ){
int sz = Math.max( poolSize , 1);
int recommendedMaxSz = Runtime.getRuntime().availableProcessors() * 2;
executor = Executors.newFixedThreadPool( Math.min( sz , recommendedMaxSz ) );
}
public Executor getExecutor() {
return executor;
}
}
|