@Override protected void onInit() throws Exception { if (cfg.isRxEnableNativeLinuxEpoll()) { System.out.println("Enabling Native Linux Transport..."); RxNetty.useNativeTransportIfApplicable(); } RxNetty.useMetricListenersFactory(new ServoEventsListenerFactory()); Builder builder = new AsyncDocumentClient.Builder() .withServiceEndpoint(cfg.getServiceEndpoint()) .withMasterKey(cfg.getMasterKey()) .withConnectionPolicy(cfg.getConnectionPolicy()) .withConsistencyLevel(cfg.getConsistencyLevel()); this.rxDocumentClient = builder.build(); }
@Override protected void onInit() throws Exception { RxNetty.useMetricListenersFactory(new ServoEventsListenerFactory()); documentClient = new DocumentClient(cfg.getServiceEndpoint(), cfg.getMasterKey(), cfg.getConnectionPolicy(), cfg.getConsistencyLevel()); ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(cfg.getConcurrency(), cfg.getConcurrency(), 10, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>(cfg.getConcurrency(), true), new ThreadPoolExecutor.CallerRunsPolicy()); this.executor = MoreExecutors.listeningDecorator(threadPoolExecutor); }
@Override protected void configure() { RxNetty.useMetricListenersFactory(new ServoEventsListenerFactory()); }