Package com.yahoo.search.searchchain
Class FutureResult
- All Implemented Interfaces:
Runnable
,Future<Result>
,RunnableFuture<Result>
Extends a
FutureTask<Result>
, with some added error handling- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget()
Returns a Result containing the hits returned from this source, or an error otherwise.Returns a Result containing the hits returned from this source, or an error otherwise.Returns the execution which creates thisgetIfAvailable
(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 timegetQuery()
Returns the query used in this execution, never nullMethods inherited from class java.util.concurrent.FutureTask
cancel, done, isCancelled, isDone, run, runAndReset, set, setException, toString
-
Constructor Details
-
FutureResult
-
-
Method Details
-
get
Returns a Result containing the hits returned from this source, or an error otherwise. This will block for however long it takes to get the result: Using this is a bad idea. -
get
Returns a Result containing the hits returned from this source, or an error otherwise. This blocks for at most the given timeout and returns a Result containing a timeout error if the result is not available within this time. -
getIfAvailable
Same as get(timeout, timeunit) but returns Optional.empty instead of a result with error if the result is not available in time -
getQuery
Returns the query used in this execution, never null -
getExecution
Returns the execution which creates this -
createTimeoutError
-