Package tkrzw
Class Future<T>
Object
Future<T>
Future containing a status object and extra data.
- Note:
- Future objects are made by methods of AsyncDBM. Every future object should be destroyed by the "destruct" method or the "get" method to free resources.
-
Method Summary
-
Method Details
-
destruct
public void destruct()Destructs the object and releases resources. -
await
public boolean await(double timeout) Awaits the operation to be done.- Parameters:
timeout
- The waiting time in seconds. If it is negative, no timeout is set.- Returns:
- True if the operation has done. False if timeout occurs.
-
get
Awaits the operation to be done and gets the result status.- Returns:
- The result status and extra data if any. The existence and the type of extra data depends on the operation which makes the future. For DBM#Get, a tuple of the status and the retrieved value is returned. For DBM#Set and DBM#Remove, the status object itself is returned.
- Note:
- The internal resource is released by this method. "aait" and "get" cannot be called after calling this method.
-
toString
Gets a string representation of the database.
-