final ScheduledExecutorService serviceScheduler = Executors.newSingleThreadScheduledExecutor();
final Client restLiClient = new ClientImpl(serviceScheduler);
final int numCores = Runtime.getRuntime().availableProcessors();
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(numCores + 1);
final Engine engine = new EngineBuilder()
.setTaskExecutor(scheduler)
.setTimerScheduler(scheduler)
.build();
final ClassifierPlanFactory classifier = new ClassifierPlanFactory(restLiClient);
try
{
final Task<Map<Long, Classification>> classifications = classifier.classify(viewerId, unclassified);
engine.run(classifications);
classifications.await();
System.out.println(classifications.get());
ExampleUtil.printTracingResults(classifications);
}
finally
{
serviceScheduler.shutdownNow();
engine.shutdown();
scheduler.shutdownNow();
}
}