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 theoriginal
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSharedData
(io.vertx.core.shareddata.SharedData delegate) SharedData
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionboolean
<K,
V> io.smallrye.mutiny.Uni<AsyncMap<K, V>> getAsyncMap
(String name) Get theAsyncMap
with the specified name.<K,
V> AsyncMap<K, V> getAsyncMapAndAwait
(String name) Blocking variant ofgetAsyncMap(String)
.<K,
V> void getAsyncMapAndForget
(String name) Variant ofgetAsyncMap(String)
that ignores the result of the operation.<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> Blocking variant ofgetClusterWideMap(String)
.<K,
V> void Variant ofgetClusterWideMap(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Counter>
getCounter
(String name) Get an asynchronous counter.getCounterAndAwait
(String name) Blocking variant ofgetCounter(String)
.void
getCounterAndForget
(String name) Variant ofgetCounter(String)
that ignores the result of the operation.io.vertx.core.shareddata.SharedData
<K,
V> io.smallrye.mutiny.Uni<AsyncMap<K, V>> getLocalAsyncMap
(String name) Get theAsyncMap
with the specified name.<K,
V> AsyncMap<K, V> Blocking variant ofgetLocalAsyncMap(String)
.<K,
V> void Variant ofgetLocalAsyncMap(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Counter>
getLocalCounter
(String name) Get an asynchronous local counter.Blocking variant ofgetLocalCounter(String)
.void
Variant ofgetLocalCounter(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Lock>
getLocalLock
(String name) Get an asynchronous local lock with the specified name.getLocalLockAndAwait
(String name) Blocking variant ofgetLocalLock(String)
.void
getLocalLockAndForget
(String name) Variant ofgetLocalLock(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Lock>
getLocalLockWithTimeout
(String name, long timeout) LikegetLocalLock(java.lang.String)
but specifying a timeout.getLocalLockWithTimeoutAndAwait
(String name, long timeout) Blocking variant ofgetLocalLockWithTimeout(String,long)
.void
getLocalLockWithTimeoutAndForget
(String name, long timeout) Variant ofgetLocalLockWithTimeout(String,long)
that ignores the result of the operation.<K,
V> LocalMap<K, V> getLocalMap
(String name) io.smallrye.mutiny.Uni<Lock>
Get an asynchronous lock with the specified name.getLockAndAwait
(String name) Blocking variant ofgetLock(String)
.void
getLockAndForget
(String name) Variant ofgetLock(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Lock>
getLockWithTimeout
(String name, long timeout) LikegetLock(java.lang.String)
but specifying a timeout.getLockWithTimeoutAndAwait
(String name, long timeout) Blocking variant ofgetLockWithTimeout(String,long)
.void
getLockWithTimeoutAndForget
(String name, long timeout) Variant ofgetLockWithTimeout(String,long)
that ignores the result of the operation.int
hashCode()
static SharedData
newInstance
(io.vertx.core.shareddata.SharedData arg) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
SharedData
-
Method Details
-
getDelegate
public io.vertx.core.shareddata.SharedData getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the map- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getClusterWideMapAndAwait
Blocking variant ofgetClusterWideMap(String)
.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).
- Parameters:
name
- the name of the map- Returns:
- the AsyncMap<K,V> instance produced by the operation.
-
getClusterWideMapAndForget
Variant ofgetClusterWideMap(String)
that ignores the result of the operation.This method subscribes on the result of
getClusterWideMap(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetClusterWideMap(String)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the map
-
getAsyncMap
Get theAsyncMap
with 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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the map- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getAsyncMapAndAwait
Blocking variant ofgetAsyncMap(String)
.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).
- Parameters:
name
- the name of the map- Returns:
- the AsyncMap<K,V> instance produced by the operation.
-
getAsyncMapAndForget
Variant ofgetAsyncMap(String)
that ignores the result of the operation.This method subscribes on the result of
getAsyncMap(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetAsyncMap(String)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the map
-
getLocalAsyncMap
Get theAsyncMap
with 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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the map- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getLocalAsyncMapAndAwait
Blocking variant ofgetLocalAsyncMap(String)
.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).
- Parameters:
name
- the name of the map- Returns:
- the AsyncMap<K,V> instance produced by the operation.
-
getLocalAsyncMapAndForget
Variant ofgetLocalAsyncMap(String)
that ignores the result of the operation.This method subscribes on the result of
getLocalAsyncMap(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetLocalAsyncMap(String)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the map
-
getLock
Get an asynchronous lock with the specified name. The lock will be passed to the handler 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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the lock- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getLockAndAwait
Blocking variant ofgetLock(String)
.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).
- Parameters:
name
- the name of the lock- Returns:
- the Lock instance produced by the operation.
-
getLockAndForget
Variant ofgetLock(String)
that ignores the result of the operation.This method subscribes on the result of
getLock(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetLock(String)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the lock
-
getLockWithTimeout
LikegetLock(java.lang.String)
but specifying a timeout. If the lock is not obtained within the timeout a failure will be sent to the handler.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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the locktimeout
- the timeout in ms- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getLockWithTimeoutAndAwait
Blocking variant ofgetLockWithTimeout(String,long)
.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).
- Parameters:
name
- the name of the locktimeout
- the timeout in ms- Returns:
- the Lock instance produced by the operation.
-
getLockWithTimeoutAndForget
Variant ofgetLockWithTimeout(String,long)
that ignores the result of the operation.This method subscribes on the result of
getLockWithTimeout(String,long)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetLockWithTimeout(String,long)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the locktimeout
- the timeout in ms
-
getLocalLock
Get an asynchronous local lock with the specified name. The lock will be passed to the handler 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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the lock- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getLocalLockAndAwait
Blocking variant ofgetLocalLock(String)
.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).
- Parameters:
name
- the name of the lock- Returns:
- the Lock instance produced by the operation.
-
getLocalLockAndForget
Variant ofgetLocalLock(String)
that ignores the result of the operation.This method subscribes on the result of
getLocalLock(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetLocalLock(String)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the lock
-
getLocalLockWithTimeout
@CheckReturnValue public io.smallrye.mutiny.Uni<Lock> getLocalLockWithTimeout(String name, long timeout) LikegetLocalLock(java.lang.String)
but specifying a timeout. If the lock is not obtained within the timeout a failure will be sent to the handler.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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the locktimeout
- the timeout in ms- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getLocalLockWithTimeoutAndAwait
Blocking variant ofgetLocalLockWithTimeout(String,long)
.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).
- Parameters:
name
- the name of the locktimeout
- the timeout in ms- Returns:
- the Lock instance produced by the operation.
-
getLocalLockWithTimeoutAndForget
Variant ofgetLocalLockWithTimeout(String,long)
that ignores the result of the operation.This method subscribes on the result of
getLocalLockWithTimeout(String,long)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetLocalLockWithTimeout(String,long)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the locktimeout
- the timeout in ms
-
getCounter
Get an asynchronous counter. The counter will be passed to the handler.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the counter.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getCounterAndAwait
Blocking variant ofgetCounter(String)
.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).
- Parameters:
name
- the name of the counter.- Returns:
- the Counter instance produced by the operation.
-
getCounterAndForget
Variant ofgetCounter(String)
that ignores the result of the operation.This method subscribes on the result of
getCounter(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetCounter(String)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the counter.
-
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
. Don't forget to subscribe on it to trigger the operation.- Parameters:
name
- the name of the counter.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
getLocalCounterAndAwait
Blocking variant ofgetLocalCounter(String)
.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).
- Parameters:
name
- the name of the counter.- Returns:
- the Counter instance produced by the operation.
-
getLocalCounterAndForget
Variant ofgetLocalCounter(String)
that ignores the result of the operation.This method subscribes on the result of
getLocalCounter(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetLocalCounter(String)
but you don't need to compose it with other operations.- Parameters:
name
- the name of the counter.
-
getLocalMap
- Parameters:
name
- the name of the map- Returns:
- the map
-