use of com.yahoo.search.searchchain.FutureResult in project vespa by vespa-engine.
the class AsyncExecutionTestCase method testAsyncExecutionTimeout.
@SuppressWarnings("deprecation")
public void testAsyncExecutionTimeout() {
Chain<Searcher> chain = new Chain<>(new Searcher() {
@Override
public Result search(Query query, Execution execution) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return new Result(query);
}
});
Execution execution = new Execution(chain, Execution.Context.createContextStub());
AsyncExecution async = new AsyncExecution(execution);
FutureResult future = async.searchAndFill(new Query());
future.get(1, TimeUnit.MILLISECONDS);
}
Aggregations