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 SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionSharedData(io.vertx.core.shareddata.SharedData delegate) SharedData(Object delegate) 
- 
Method SummaryModifier 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) 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).voidgetCounterAndForget(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 theAsyncMapwith 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).voidVariant 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).voidgetLocalLockAndForget(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).voidgetLocalLockWithTimeoutAndForget(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).voidgetLockAndForget(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).voidgetLockWithTimeoutAndForget(String name, long timeout) Variant ofgetLockWithTimeout(String,long)that ignores the result of the operation.inthashCode()static SharedDatanewInstance(io.vertx.core.shareddata.SharedData arg) toString()
- 
Field Details- 
__TYPE_ARG
 
- 
- 
Constructor Details
- 
SharedData
 
- 
Method Details- 
getDelegatepublic io.vertx.core.shareddata.SharedData getDelegate()- Specified by:
- getDelegatein interface- MutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
 
- 
toString
- 
equals
- 
hashCodepublic 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 unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getClusterWideMapAndAwaitBlocking 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.
 
- 
getClusterWideMapAndForgetVariant 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
 
- 
getAsyncMapGet 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. Don't forget to subscribe on it to trigger the operation.- Parameters:
- name- the name of the map
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getAsyncMapAndAwaitBlocking 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.
 
- 
getAsyncMapAndForgetVariant 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
 
- 
getLocalAsyncMapGet 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. Don't forget to subscribe on it to trigger the operation.- Parameters:
- name- the name of the map
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getLocalAsyncMapAndAwaitBlocking 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.
 
- 
getLocalAsyncMapAndForgetVariant 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
 
- 
getLockGet 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 unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getLockAndAwaitBlocking 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.
 
- 
getLockAndForgetVariant 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
 
- 
getLockWithTimeoutLikegetLock(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 lock
- timeout- the timeout in ms
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getLockWithTimeoutAndAwaitBlocking 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 lock
- timeout- the timeout in ms
- Returns:
- the Lock instance produced by the operation.
 
- 
getLockWithTimeoutAndForgetVariant 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 lock
- timeout- the timeout in ms
 
- 
getLocalLockGet 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 unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getLocalLockAndAwaitBlocking 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.
 
- 
getLocalLockAndForgetVariant 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 lock
- timeout- the timeout in ms
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getLocalLockWithTimeoutAndAwaitBlocking 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 lock
- timeout- the timeout in ms
- Returns:
- the Lock instance produced by the operation.
 
- 
getLocalLockWithTimeoutAndForgetVariant 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 lock
- timeout- the timeout in ms
 
- 
getCounterGet 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 unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getCounterAndAwaitBlocking 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.
 
- 
getCounterAndForgetVariant 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.
 
- 
getLocalCounterGet 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 unifiring the result of the operation when completed, or a failure if the operation failed.
 
- 
getLocalCounterAndAwaitBlocking 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.
 
- 
getLocalCounterAndForgetVariant 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
 
 
-