public class ResultLatch extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ResultLatch.Callback
Callback interface.
|
Constructor and Description |
---|
ResultLatch(QdsClient client,
int queryId) |
ResultLatch(QdsClient client,
String queryId) |
Modifier and Type | Method and Description |
---|---|
void |
await()
Await indefinitely for the result
|
boolean |
await(long maxWait,
TimeUnit timeUnit)
Await up to a maximum time for the result
|
ResultValue |
awaitResult()
Await indefinitely for the result
|
ResultValue |
awaitResult(long maxWait,
TimeUnit timeUnit)
Await up to a maximum time for the result
|
void |
callback(ResultLatch.Callback callback)
This method returns immediately and polls asynchronously for the result.
|
void |
setPollSleep(long time,
TimeUnit unit)
Change the time that the query status is polled.
|
public ResultLatch(QdsClient client, int queryId)
client
- the clientqueryId
- the querypublic void setPollSleep(long time, TimeUnit unit)
DEFAULT_POLL_MS
.time
- polling timeunit
- time unitpublic void callback(ResultLatch.Callback callback)
callback
- callbackpublic void await() throws Exception
Exception
- errorspublic boolean await(long maxWait, TimeUnit timeUnit) throws Exception
maxWait
- max wait timetimeUnit
- time unitException
- errorspublic ResultValue awaitResult() throws Exception
Exception
- errorspublic ResultValue awaitResult(long maxWait, TimeUnit timeUnit) throws Exception
maxWait
- max wait timetimeUnit
- time unitException
- errorsCopyright © 2020. All rights reserved.