public class FutureResult extends FutureTask<Result>
FutureTask<Result>
, with some added error handlingConstructor and Description |
---|
FutureResult(Callable<Result> callable,
Execution execution,
Query query) |
Modifier and Type | Method and Description |
---|---|
ErrorMessage |
createTimeoutError() |
Result |
get()
Returns a Result containing the hits returned from this source, or an error otherwise.
|
Result |
get(long timeout,
TimeUnit timeunit)
Returns a Result containing the hits returned from this source, or an error otherwise.
|
Optional<Result> |
getIfAvailable(long timeout,
TimeUnit timeunit)
Same as get(timeout, timeunit) but returns Optional.empty instead of a result with error if the result is
not available in time
|
Query |
getQuery()
Returns the query used in this execution, never null
|
cancel, done, isCancelled, isDone, run, runAndReset, set, setException
public Result get()
public Result get(long timeout, TimeUnit timeunit)
public Optional<Result> getIfAvailable(long timeout, TimeUnit timeunit)
public Query getQuery()
public ErrorMessage createTimeoutError()
Copyright © 2018. All rights reserved.