Package net.spy.memcached.internal
Interface BulkFuture<V>
- Type Parameters:
V
-
- All Superinterfaces:
Future<V>
- All Known Implementing Classes:
BulkGetFuture
Additional flexibility for asyncGetBulk
This interface is now returned from all asyncGetBulk methods. Unlike
Future.get(long, TimeUnit)
, getSome(long, TimeUnit)
does not throw
CheckedOperationTimeoutException, thus allowing retrieval of partial results
after timeout occurs. This behavior is especially useful in case of large
multi gets.
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Method Summary
Modifier and TypeMethodDescriptionaddListener
(BulkGetCompletionListener listener) Add a listener to the future, which will be executed once the operation completes.Wait for the operation to complete and return results If operation could not complete within specified timeout, partial result is returned.Gets the status of the operation upon completion.boolean
removeListener
(BulkGetCompletionListener listener) Remove a previously added listener from the future.Methods inherited from interface java.util.concurrent.Future
cancel, exceptionNow, get, get, isCancelled, isDone, resultNow, state
-
Method Details
-
isTimeout
boolean isTimeout()- Returns:
- true if timeout was reached, false otherwise
-
getSome
Wait for the operation to complete and return results If operation could not complete within specified timeout, partial result is returned. Otherwise, the behavior is identical toFuture.get(long, TimeUnit)
- Parameters:
timeout
-unit
-- Returns:
- a partial get bulk result
- Throws:
InterruptedException
ExecutionException
-
getStatus
OperationStatus getStatus()Gets the status of the operation upon completion.- Returns:
- the operation status.
-
addListener
Add a listener to the future, which will be executed once the operation completes.- Parameters:
listener
- the listener which will be executed.- Returns:
- the current future to allow for object-chaining.
-
removeListener
Remove a previously added listener from the future.- Parameters:
listener
- the previously added listener.- Returns:
- the current future to allow for object-chaining.
-