Class SharedData
- All Implemented Interfaces:
MutinyDelegate
Shared data provides:
- synchronous shared maps (local)
- asynchronous maps (local or cluster-wide)
- asynchronous locks (local or cluster-wide)
- asynchronous counters (local or cluster-wide)
WARNING: In clustered mode, asynchronous maps/locks/counters rely on distributed data structures provided by the cluster manager. Beware that the latency relative to asynchronous maps/locks/counters operations can be much higher in clustered than in local mode.
Please see the documentation for more information.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tim Fox
- See Also:
-
SharedData
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSharedData(io.vertx.core.shareddata.SharedData delegate) Create a new instance ofSharedDatadelegating to the given (non-null) instance ofSharedData.SharedData(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionboolean<K,V> io.smallrye.mutiny.Uni<AsyncMap<K, V>> getAsyncMap(String name) Get theAsyncMapwith the specified name.<K,V> AsyncMap<K, V> getAsyncMapAndAwait(String name) Get theAsyncMapwith the specified name.<K,V> SharedData getAsyncMapAndForget(String name) Get theAsyncMapwith the specified name.<K,V> io.smallrye.mutiny.Uni<AsyncMap<K, V>> getClusterWideMap(String name) Get the cluster wide map with the specified name.<K,V> AsyncMap<K, V> Get the cluster wide map with the specified name.<K,V> SharedData Get the cluster wide map with the specified name.io.smallrye.mutiny.Uni<Counter>getCounter(String name) Get an asynchronous counter.getCounterAndAwait(String name) Get an asynchronous counter.getCounterAndForget(String name) Get an asynchronous counter.io.vertx.core.shareddata.SharedDataGet the delegate instance.<K,V> io.smallrye.mutiny.Uni<AsyncMap<K, V>> getLocalAsyncMap(String name) Get theAsyncMapwith the specified name.<K,V> AsyncMap<K, V> Get theAsyncMapwith the specified name.<K,V> SharedData Get theAsyncMapwith the specified name.io.smallrye.mutiny.Uni<Counter>getLocalCounter(String name) Get an asynchronous local counter.Get an asynchronous local counter.Get an asynchronous local counter.io.smallrye.mutiny.Uni<Lock>getLocalLock(String name) Get an asynchronous local lock with the specified name.getLocalLockAndAwait(String name) Get an asynchronous local lock with the specified name.getLocalLockAndForget(String name) Get an asynchronous local lock with the specified name.io.smallrye.mutiny.Uni<Lock>getLocalLockWithTimeout(String name, long timeout) LikegetLocalLock(String)but specifying a timeout.getLocalLockWithTimeoutAndAwait(String name, long timeout) LikegetLocalLock(String)but specifying a timeout.getLocalLockWithTimeoutAndForget(String name, long timeout) LikegetLocalLock(String)but specifying a timeout.<K,V> LocalMap<K, V> getLocalMap(String name) Return aLocalMapwith the specificname.io.smallrye.mutiny.Uni<Lock>Get an asynchronous lock with the specified name.getLockAndAwait(String name) Get an asynchronous lock with the specified name.getLockAndForget(String name) Get an asynchronous lock with the specified name.io.smallrye.mutiny.Uni<Lock>getLockWithTimeout(String name, long timeout) LikegetLock(String)but specifying a timeout.getLockWithTimeoutAndAwait(String name, long timeout) LikegetLock(String)but specifying a timeout.getLockWithTimeoutAndForget(String name, long timeout) LikegetLock(String)but specifying a timeout.inthashCode()static SharedDatanewInstance(io.vertx.core.shareddata.SharedData delegate) Creates a new instance of theSharedData.toString()<T> io.smallrye.mutiny.Uni<T>withLocalLock(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLocalLock(String, Supplier)but specifying a timeout.<T> io.smallrye.mutiny.Uni<T>withLocalLock(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous local lock with the specified name.<T> TwithLocalLockAndAwait(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLocalLock(String, Supplier)but specifying a timeout.<T> TwithLocalLockAndAwait(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous local lock with the specified name.<T> SharedDatawithLocalLockAndForget(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLocalLock(String, Supplier)but specifying a timeout.<T> SharedDatawithLocalLockAndForget(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous local lock with the specified name.<T> io.smallrye.mutiny.Uni<T>LikewithLock(String, Supplier)but specifying a timeout.<T> io.smallrye.mutiny.Uni<T>Get an asynchronous lock with the specified name.<T> TwithLockAndAwait(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLock(String, Supplier)but specifying a timeout.<T> TwithLockAndAwait(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous lock with the specified name.<T> SharedDatawithLockAndForget(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLock(String, Supplier)but specifying a timeout.<T> SharedDatawithLockAndForget(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous lock with the specified name.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
SharedData
-
Method Details
-
getDelegate
public io.vertx.core.shareddata.SharedData getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
getClusterWideMap
@CheckReturnValue public <K,V> io.smallrye.mutiny.Uni<AsyncMap<K,V>> getClusterWideMap(String name) Get the cluster wide map with the specified name. The map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the map- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getClusterWideMap(String)
-
getClusterWideMapAndAwait
Get the cluster wide map with the specified name. The map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.Unlike the bare Vert.x variant, this method returns a
AsyncMap<K,. This method awaits indefinitely 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 aV> RuntimeException).- Parameters:
name- the name of the map- Returns:
- The operation result
- See Also:
-
SharedData.getClusterWideMap(String)
-
getClusterWideMapAndForget
Get the cluster wide map with the specified name. The map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.Unlike the bare Vert.x variant, this method ignores the
AsyncMap<K,result or any failure.V> - Parameters:
name- the name of the map- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getClusterWideMap(String)
-
getAsyncMap
Get theAsyncMapwith the specified name. When clustered, the map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.WARNING: In clustered mode, asynchronous shared maps rely on distributed data structures provided by the cluster manager. Beware that the latency relative to asynchronous shared maps operations can be much higher in clustered than in local mode.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the map- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getAsyncMap(String)
-
getAsyncMapAndAwait
Get theAsyncMapwith the specified name. When clustered, the map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.WARNING: In clustered mode, asynchronous shared maps rely on distributed data structures provided by the cluster manager. Beware that the latency relative to asynchronous shared maps operations can be much higher in clustered than in local mode.
Unlike the bare Vert.x variant, this method returns a
AsyncMap<K,. This method awaits indefinitely 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 aV> RuntimeException).- Parameters:
name- the name of the map- Returns:
- The operation result
- See Also:
-
SharedData.getAsyncMap(String)
-
getAsyncMapAndForget
Get theAsyncMapwith the specified name. When clustered, the map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.WARNING: In clustered mode, asynchronous shared maps rely on distributed data structures provided by the cluster manager. Beware that the latency relative to asynchronous shared maps operations can be much higher in clustered than in local mode.
Unlike the bare Vert.x variant, this method ignores the
AsyncMap<K,result or any failure.V> - Parameters:
name- the name of the map- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getAsyncMap(String)
-
getLocalAsyncMap
Get theAsyncMapwith the specified name.When clustered, the map is NOT accessible to all nodes in the cluster. Only the instance which created the map can put and retrieve data from this map.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the map- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getLocalAsyncMap(String)
-
getLocalAsyncMapAndAwait
Get theAsyncMapwith the specified name.When clustered, the map is NOT accessible to all nodes in the cluster. Only the instance which created the map can put and retrieve data from this map.
Unlike the bare Vert.x variant, this method returns a
AsyncMap<K,. This method awaits indefinitely 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 aV> RuntimeException).- Parameters:
name- the name of the map- Returns:
- The operation result
- See Also:
-
SharedData.getLocalAsyncMap(String)
-
getLocalAsyncMapAndForget
Get theAsyncMapwith the specified name.When clustered, the map is NOT accessible to all nodes in the cluster. Only the instance which created the map can put and retrieve data from this map.
Unlike the bare Vert.x variant, this method ignores the
AsyncMap<K,result or any failure.V> - Parameters:
name- the name of the map- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getLocalAsyncMap(String)
-
getLock
Get an asynchronous lock with the specified name. The returned uni will be completed with the lock when it is available.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the lock- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getLock(String)
-
getLockAndAwait
Get an asynchronous lock with the specified name. The returned underlying uni will be completed with the lock when it is available.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Lock. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the lock- Returns:
- The operation result
- See Also:
-
SharedData.getLock(String)
-
getLockAndForget
Get an asynchronous lock with the specified name. The returned underlying uni will be completed with the lock when it is available.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method ignores the
Lockresult or any failure.- Parameters:
name- the name of the lock- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getLock(String)
-
getLockWithTimeout
LikegetLock(String)but specifying a timeout. If the lock is not obtained within the timeout the returned future is failed.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the locktimeout- the timeout in ms- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getLockWithTimeout(String, long)
-
getLockWithTimeoutAndAwait
LikegetLock(String)but specifying a timeout. If the lock is not obtained within the timeout the returned future is failed.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Lock. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the locktimeout- the timeout in ms- Returns:
- The operation result
- See Also:
-
SharedData.getLockWithTimeout(String, long)
-
getLockWithTimeoutAndForget
LikegetLock(String)but specifying a timeout. If the lock is not obtained within the timeout the returned future is failed.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method ignores the
Lockresult or any failure.- Parameters:
name- the name of the locktimeout- the timeout in ms- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getLockWithTimeout(String, long)
-
withLock
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> withLock(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous lock with the specified name.When the
blockis called, the lock is already acquired, it will be released when theFuture<T>returned by the block completes.When the
blockfails, the lock is released and the returned uni is failed with the cause of the failure.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the lock- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.withLock(String, Supplier)
-
withLockAndAwait
Get an asynchronous lock with the specified name.When the
blockis called, the lock is already acquired, it will be released when theFuture<T>returned by the block completes.When the
blockfails, the lock is released and the returned underlying uni is failed with the cause of the failure.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
SharedData. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the lock- Returns:
- The operation result
- See Also:
-
SharedData.withLock(String, Supplier)
-
withLockAndForget
Get an asynchronous lock with the specified name.When the
blockis called, the lock is already acquired, it will be released when theFuture<T>returned by the block completes.When the
blockfails, the lock is released and the returned underlying uni is failed with the cause of the failure.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method ignores the
SharedDataresult or any failure.- Parameters:
name- the name of the lock- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.withLock(String, Supplier)
-
withLock
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> withLock(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLock(String, Supplier)but specifying a timeout. If the lock is not obtained within the timeout the returned uni is failed.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the locktimeout- the timeout in msblock- the code block called after lock acquisition- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.withLock(String, long, Supplier)
-
withLockAndAwait
LikewithLock(String, Supplier)but specifying a timeout. If the lock is not obtained within the timeout the returned underlying uni is failed.Unlike the bare Vert.x variant, this method returns a
SharedData. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the locktimeout- the timeout in msblock- the code block called after lock acquisition- Returns:
- The operation result
- See Also:
-
SharedData.withLock(String, long, Supplier)
-
withLockAndForget
public <T> SharedData withLockAndForget(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLock(String, Supplier)but specifying a timeout. If the lock is not obtained within the timeout the returned underlying uni is failed.Unlike the bare Vert.x variant, this method ignores the
SharedDataresult or any failure.- Parameters:
name- the name of the locktimeout- the timeout in msblock- the code block called after lock acquisition- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.withLock(String, long, Supplier)
-
getLocalLock
Get an asynchronous local lock with the specified name. The returned uni will be completed with the lock when it is available.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the lock- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getLocalLock(String)
-
getLocalLockAndAwait
Get an asynchronous local lock with the specified name. The returned underlying uni will be completed with the lock when it is available.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Lock. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the lock- Returns:
- The operation result
- See Also:
-
SharedData.getLocalLock(String)
-
getLocalLockAndForget
Get an asynchronous local lock with the specified name. The returned underlying uni will be completed with the lock when it is available.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method ignores the
Lockresult or any failure.- Parameters:
name- the name of the lock- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getLocalLock(String)
-
getLocalLockWithTimeout
@CheckReturnValue public io.smallrye.mutiny.Uni<Lock> getLocalLockWithTimeout(String name, long timeout) LikegetLocalLock(String)but specifying a timeout. If the lock is not obtained within the timeout the returned future is failed.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the locktimeout- the timeout in ms- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getLocalLockWithTimeout(String, long)
-
getLocalLockWithTimeoutAndAwait
LikegetLocalLock(String)but specifying a timeout. If the lock is not obtained within the timeout the returned future is failed.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Lock. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the locktimeout- the timeout in ms- Returns:
- The operation result
- See Also:
-
SharedData.getLocalLockWithTimeout(String, long)
-
getLocalLockWithTimeoutAndForget
LikegetLocalLock(String)but specifying a timeout. If the lock is not obtained within the timeout the returned future is failed.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method ignores the
Lockresult or any failure.- Parameters:
name- the name of the locktimeout- the timeout in ms- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getLocalLockWithTimeout(String, long)
-
withLocalLock
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> withLocalLock(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous local lock with the specified name.When the
blockis called, the lock is already acquired, it will be released when theFuture<T>returned by the block completes.When the
blockfails, the lock is released and the returned uni is failed with the cause of the failure.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the lock- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.withLocalLock(String, Supplier)
-
withLocalLockAndAwait
Get an asynchronous local lock with the specified name.When the
blockis called, the lock is already acquired, it will be released when theFuture<T>returned by the block completes.When the
blockfails, the lock is released and the returned underlying uni is failed with the cause of the failure.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method returns a
SharedData. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the lock- Returns:
- The operation result
- See Also:
-
SharedData.withLocalLock(String, Supplier)
-
withLocalLockAndForget
public <T> SharedData withLocalLockAndForget(String name, Supplier<io.smallrye.mutiny.Uni<T>> block) Get an asynchronous local lock with the specified name.When the
blockis called, the lock is already acquired, it will be released when theFuture<T>returned by the block completes.When the
blockfails, the lock is released and the returned underlying uni is failed with the cause of the failure.In general lock acquision is unordered, so that sequential attempts to acquire a lock, even from a single thread, can happen in non-sequential order.
Unlike the bare Vert.x variant, this method ignores the
SharedDataresult or any failure.- Parameters:
name- the name of the lock- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.withLocalLock(String, Supplier)
-
withLocalLock
@CheckReturnValue public <T> io.smallrye.mutiny.Uni<T> withLocalLock(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLocalLock(String, Supplier)but specifying a timeout. If the lock is not obtained within the timeout the returned uni is failed.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the locktimeout- the timeout in msblock- the code block called after lock acquisition- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.withLocalLock(String, long, Supplier)
-
withLocalLockAndAwait
public <T> T withLocalLockAndAwait(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLocalLock(String, Supplier)but specifying a timeout. If the lock is not obtained within the timeout the returned underlying uni is failed.Unlike the bare Vert.x variant, this method returns a
SharedData. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the locktimeout- the timeout in msblock- the code block called after lock acquisition- Returns:
- The operation result
- See Also:
-
SharedData.withLocalLock(String, long, Supplier)
-
withLocalLockAndForget
public <T> SharedData withLocalLockAndForget(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block) LikewithLocalLock(String, Supplier)but specifying a timeout. If the lock is not obtained within the timeout the returned underlying uni is failed.Unlike the bare Vert.x variant, this method ignores the
SharedDataresult or any failure.- Parameters:
name- the name of the locktimeout- the timeout in msblock- the code block called after lock acquisition- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.withLocalLock(String, long, Supplier)
-
getCounter
Get an asynchronous counter. The counter will be passed to the handler.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the counter.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getCounter(String)
-
getCounterAndAwait
Get an asynchronous counter. The counter will be passed to the handler.Unlike the bare Vert.x variant, this method returns a
Counter. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the counter.- Returns:
- The operation result
- See Also:
-
SharedData.getCounter(String)
-
getCounterAndForget
Get an asynchronous counter. The counter will be passed to the handler.Unlike the bare Vert.x variant, this method ignores the
Counterresult or any failure.- Parameters:
name- the name of the counter.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getCounter(String)
-
getLocalCounter
Get an asynchronous local counter. The counter will be passed to the handler.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
name- the name of the counter.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SharedData.getLocalCounter(String)
-
getLocalCounterAndAwait
Get an asynchronous local counter. The counter will be passed to the handler.Unlike the bare Vert.x variant, this method returns a
Counter. This method awaits indefinitely 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 aRuntimeException).- Parameters:
name- the name of the counter.- Returns:
- The operation result
- See Also:
-
SharedData.getLocalCounter(String)
-
getLocalCounterAndForget
Get an asynchronous local counter. The counter will be passed to the handler.Unlike the bare Vert.x variant, this method ignores the
Counterresult or any failure.- Parameters:
name- the name of the counter.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SharedData.getLocalCounter(String)
-
getLocalMap
Return aLocalMapwith the specificname.- Parameters:
name- the name of the map- Returns:
- the map
-
hashCode
public int hashCode() -
equals
-
toString
-