Interface QueryProcessorConnection.QueryHandle
- All Known Subinterfaces:
QueryProcessorConnection.QueryFuture<RETURN_TYPE>
- Enclosing interface:
- QueryProcessorConnection
public static interface QueryProcessorConnection.QueryHandle
Interface returned from asynchronous queries. This handle may be used to wait for the query to complete, or to
cancel execution of the query.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
await()
block until the query is finishedvoid
await
(long timeoutMillis) await but only as long as the timeoutboolean
cancel()
Attempt to cancel the query.boolean
Attempt to cancel the query.boolean
isReady()
Check if the query has completed and produced a result.
-
Method Details
-
isReady
boolean isReady()Check if the query has completed and produced a result. If this method returns 'true' a call toawait()
orQueryProcessorConnection.QueryFuture.get()
will return immediately.- Returns:
- true if completed, false otherwise.
-
await
block until the query is finished- Throws:
InterruptedException
-
await
await but only as long as the timeout- Throws:
InterruptedException
-
cancel
boolean cancel()Attempt to cancel the query. This might return false if the query is finished or the query is shutting down.- Returns:
- true if the cancel attempt is possible
-
cancel
Attempt to cancel the query. This might return false if the query is finished or the query is shutting down.- Parameters:
message
- an optional message to be passed to the query in theCommand
arguments- Returns:
- true if the cancel attempt is possible
-