Package io.atomix.primitive
Interface AsyncPrimitive
- All Superinterfaces:
DistributedPrimitive
- All Known Implementing Classes:
AbstractAsyncPrimitive
public interface AsyncPrimitive extends DistributedPrimitive
Asynchronous primitive.
-
Field Summary
Fields inherited from interface io.atomix.primitive.DistributedPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS -
Method Summary
Modifier and Type Method Description CompletableFuture<Void>close()Closes the primitive.CompletableFuture<Void>delete()Purges state associated with this primitive.SyncPrimitivesync()Returns a synchronous wrapper around the asynchronous primitive.SyncPrimitivesync(java.time.Duration operationTimeout)Returns a synchronous wrapper around the asynchronous primitive.Methods inherited from interface io.atomix.primitive.DistributedPrimitive
addStateChangeListener, name, protocol, removeStateChangeListener, type
-
Method Details
-
close
CompletableFuture<Void> close()Closes the primitive.- Returns:
- a future to be completed once the primitive is closed
-
delete
CompletableFuture<Void> delete()Purges state associated with this primitive.Implementations can override and provide appropriate clean up logic for purging any state state associated with the primitive. Whether modifications made within the destroy method have local or global visibility is left unspecified.
- Returns:
CompletableFuturethat is completed when the operation completes
-
sync
SyncPrimitive sync()Returns a synchronous wrapper around the asynchronous primitive.- Returns:
- the synchronous primitive
-
sync
Returns a synchronous wrapper around the asynchronous primitive.- Parameters:
operationTimeout- the synchronous operation timeout- Returns:
- the synchronous primitive
-