Package io.vertx.mutiny.core.file
Class AsyncFileLock
- java.lang.Object
-
- io.vertx.mutiny.core.file.AsyncFileLock
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<AsyncFileLock>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description AsyncFileLock(io.vertx.core.file.AsyncFileLock delegate)AsyncFileLock(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)io.vertx.core.file.AsyncFileLockgetDelegate()inthashCode()booleanisShared()io.smallrye.mutiny.Uni<Boolean>isValid()LikeisValid()but thehandlerwill be called when the operation completes or if an error occurs.BooleanisValidAndAwait()Blocking variant ofisValid().voidisValidAndForget()Variant ofisValid()that ignores the result of the operation.booleanisValidBlocking()static AsyncFileLocknewInstance(io.vertx.core.file.AsyncFileLock arg)booleanoverlaps(long position, long size)longposition()io.smallrye.mutiny.Uni<Void>release()Likerelease()but thehandlerwill be called when the operation completes or if an error occurs.VoidreleaseAndAwait()Blocking variant ofrelease().voidreleaseAndForget()Variant ofrelease()that ignores the result of the operation.voidreleaseBlocking()longsize()StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<AsyncFileLock> __TYPE_ARG
-
-
Constructor Detail
-
AsyncFileLock
public AsyncFileLock(io.vertx.core.file.AsyncFileLock delegate)
-
AsyncFileLock
public AsyncFileLock(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.core.file.AsyncFileLock getDelegate()
-
position
public long position()
- Returns:
- the position of the first byte of the locked region
-
size
public long size()
- Returns:
- the size in bytes of the locked region
-
isShared
public boolean isShared()
- Returns:
trueif this lock is shared, otherwisefalse
-
overlaps
public boolean overlaps(long position, long size)- Parameters:
position-size-- Returns:
trueif this lock overlaps with the range described bypositionandsize, otherwisefalse
-
isValidBlocking
public boolean isValidBlocking()
- Returns:
-
isValid
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> isValid()
LikeisValid()but thehandlerwill be called when the operation completes or if an error occurs.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
isValidAndAwait
public Boolean isValidAndAwait()
Blocking variant ofisValid().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Boolean instance produced by the operation.
-
isValidAndForget
public void isValidAndForget()
-
releaseBlocking
public void releaseBlocking()
-
release
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> release()
Likerelease()but thehandlerwill be called when the operation completes or if an error occurs.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
releaseAndAwait
public Void releaseAndAwait()
Blocking variant ofrelease().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
releaseAndForget
public void releaseAndForget()
-
newInstance
public static AsyncFileLock newInstance(io.vertx.core.file.AsyncFileLock arg)
-
-