Class SharedData

java.lang.Object
io.vertx.mutiny.core.shareddata.SharedData
All Implemented Interfaces:
MutinyDelegate

public class SharedData extends Object implements MutinyDelegate
Shared data allows you to share data safely between different parts of your application in a safe way.

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 Details

  • Constructor Details

    • SharedData

      public SharedData(io.vertx.core.shareddata.SharedData delegate)
      Create a new instance of SharedData delegating to the given (non-null) instance of SharedData.
    • SharedData

      public SharedData(Object delegate)
  • 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:
      getDelegate in interface MutinyDelegate
      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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getClusterWideMap(String)
    • getClusterWideMapAndAwait

      public <K, V> AsyncMap<K,V> getClusterWideMapAndAwait(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 AsyncMap<K,V>. 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 a RuntimeException).

      Parameters:
      name - the name of the map
      Returns:
      The operation result
      See Also:
      • SharedData.getClusterWideMap(String)
    • getClusterWideMapAndForget

      public <K, V> SharedData getClusterWideMapAndForget(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 ignores the AsyncMap<K,V> result or any failure.

      Parameters:
      name - the name of the map
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SharedData.getClusterWideMap(String)
    • getAsyncMap

      @CheckReturnValue public <K, V> io.smallrye.mutiny.Uni<AsyncMap<K,V>> getAsyncMap(String name)
      Get the AsyncMap 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. 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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getAsyncMap(String)
    • getAsyncMapAndAwait

      public <K, V> AsyncMap<K,V> getAsyncMapAndAwait(String name)
      Get the AsyncMap 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 AsyncMap<K,V>. 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 a RuntimeException).

      Parameters:
      name - the name of the map
      Returns:
      The operation result
      See Also:
      • SharedData.getAsyncMap(String)
    • getAsyncMapAndForget

      public <K, V> SharedData getAsyncMapAndForget(String name)
      Get the AsyncMap 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 ignores the AsyncMap<K,V> result or any failure.

      Parameters:
      name - the name of the map
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SharedData.getAsyncMap(String)
    • getLocalAsyncMap

      @CheckReturnValue public <K, V> io.smallrye.mutiny.Uni<AsyncMap<K,V>> getLocalAsyncMap(String name)
      Get the AsyncMap 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. 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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getLocalAsyncMap(String)
    • getLocalAsyncMapAndAwait

      public <K, V> AsyncMap<K,V> getLocalAsyncMapAndAwait(String name)
      Get the AsyncMap 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 AsyncMap<K,V>. 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 a RuntimeException).

      Parameters:
      name - the name of the map
      Returns:
      The operation result
      See Also:
      • SharedData.getLocalAsyncMap(String)
    • getLocalAsyncMapAndForget

      public <K, V> SharedData getLocalAsyncMapAndForget(String name)
      Get the AsyncMap 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 ignores the AsyncMap<K,V> result or any failure.

      Parameters:
      name - the name of the map
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SharedData.getLocalAsyncMap(String)
    • getLock

      @CheckReturnValue public io.smallrye.mutiny.Uni<Lock> getLock(String name)
      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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getLock(String)
    • getLockAndAwait

      public Lock getLockAndAwait(String name)
      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 a RuntimeException).

      Parameters:
      name - the name of the lock
      Returns:
      The operation result
      See Also:
      • SharedData.getLock(String)
    • getLockAndForget

      public SharedData getLockAndForget(String name)
      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 Lock result 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

      @CheckReturnValue public io.smallrye.mutiny.Uni<Lock> getLockWithTimeout(String name, long timeout)
      Like getLock(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 lock
      timeout - the timeout in ms
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getLockWithTimeout(String, long)
    • getLockWithTimeoutAndAwait

      public Lock getLockWithTimeoutAndAwait(String name, long timeout)
      Like getLock(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 a RuntimeException).

      Parameters:
      name - the name of the lock
      timeout - the timeout in ms
      Returns:
      The operation result
      See Also:
      • SharedData.getLockWithTimeout(String, long)
    • getLockWithTimeoutAndForget

      public SharedData getLockWithTimeoutAndForget(String name, long timeout)
      Like getLock(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 Lock result or any failure.

      Parameters:
      name - the name of the lock
      timeout - 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 block is called, the lock is already acquired, it will be released when the Future<T> returned by the block completes.

      When the block fails, 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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.withLock(String, Supplier)
    • withLockAndAwait

      public <T> T withLockAndAwait(String name, Supplier<io.smallrye.mutiny.Uni<T>> block)
      Get an asynchronous lock with the specified name.

      When the block is called, the lock is already acquired, it will be released when the Future<T> returned by the block completes.

      When the block fails, 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 a RuntimeException).

      Parameters:
      name - the name of the lock
      Returns:
      The operation result
      See Also:
      • SharedData.withLock(String, Supplier)
    • withLockAndForget

      public <T> SharedData withLockAndForget(String name, Supplier<io.smallrye.mutiny.Uni<T>> block)
      Get an asynchronous lock with the specified name.

      When the block is called, the lock is already acquired, it will be released when the Future<T> returned by the block completes.

      When the block fails, 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 SharedData result 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)
      Like withLock(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 lock
      timeout - the timeout in ms
      block - the code block called after lock acquisition
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.withLock(String, long, Supplier)
    • withLockAndAwait

      public <T> T withLockAndAwait(String name, long timeout, Supplier<io.smallrye.mutiny.Uni<T>> block)
      Like withLock(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 a RuntimeException).

      Parameters:
      name - the name of the lock
      timeout - the timeout in ms
      block - 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)
      Like withLock(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 SharedData result or any failure.

      Parameters:
      name - the name of the lock
      timeout - the timeout in ms
      block - the code block called after lock acquisition
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SharedData.withLock(String, long, Supplier)
    • getLocalLock

      @CheckReturnValue public io.smallrye.mutiny.Uni<Lock> getLocalLock(String name)
      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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getLocalLock(String)
    • getLocalLockAndAwait

      public Lock getLocalLockAndAwait(String name)
      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 a RuntimeException).

      Parameters:
      name - the name of the lock
      Returns:
      The operation result
      See Also:
      • SharedData.getLocalLock(String)
    • getLocalLockAndForget

      public SharedData getLocalLockAndForget(String name)
      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 Lock result 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)
      Like getLocalLock(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 lock
      timeout - the timeout in ms
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getLocalLockWithTimeout(String, long)
    • getLocalLockWithTimeoutAndAwait

      public Lock getLocalLockWithTimeoutAndAwait(String name, long timeout)
      Like getLocalLock(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 a RuntimeException).

      Parameters:
      name - the name of the lock
      timeout - the timeout in ms
      Returns:
      The operation result
      See Also:
      • SharedData.getLocalLockWithTimeout(String, long)
    • getLocalLockWithTimeoutAndForget

      public SharedData getLocalLockWithTimeoutAndForget(String name, long timeout)
      Like getLocalLock(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 Lock result or any failure.

      Parameters:
      name - the name of the lock
      timeout - 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 block is called, the lock is already acquired, it will be released when the Future<T> returned by the block completes.

      When the block fails, 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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.withLocalLock(String, Supplier)
    • withLocalLockAndAwait

      public <T> T withLocalLockAndAwait(String name, Supplier<io.smallrye.mutiny.Uni<T>> block)
      Get an asynchronous local lock with the specified name.

      When the block is called, the lock is already acquired, it will be released when the Future<T> returned by the block completes.

      When the block fails, 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 a RuntimeException).

      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 block is called, the lock is already acquired, it will be released when the Future<T> returned by the block completes.

      When the block fails, 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 SharedData result 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)
      Like withLocalLock(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 lock
      timeout - the timeout in ms
      block - the code block called after lock acquisition
      Returns:
      A Uni representing 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)
      Like withLocalLock(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 a RuntimeException).

      Parameters:
      name - the name of the lock
      timeout - the timeout in ms
      block - 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)
      Like withLocalLock(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 SharedData result or any failure.

      Parameters:
      name - the name of the lock
      timeout - the timeout in ms
      block - the code block called after lock acquisition
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SharedData.withLocalLock(String, long, Supplier)
    • getCounter

      @CheckReturnValue public io.smallrye.mutiny.Uni<Counter> getCounter(String name)
      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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getCounter(String)
    • getCounterAndAwait

      public Counter getCounterAndAwait(String name)
      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 a RuntimeException).

      Parameters:
      name - the name of the counter.
      Returns:
      The operation result
      See Also:
      • SharedData.getCounter(String)
    • getCounterAndForget

      public SharedData getCounterAndForget(String name)
      Get an asynchronous counter. The counter will be passed to the handler.

      Unlike the bare Vert.x variant, this method ignores the Counter result 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

      @CheckReturnValue public io.smallrye.mutiny.Uni<Counter> getLocalCounter(String name)
      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 Uni representing the asynchronous result of this operation.
      See Also:
      • SharedData.getLocalCounter(String)
    • getLocalCounterAndAwait

      public Counter getLocalCounterAndAwait(String name)
      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 a RuntimeException).

      Parameters:
      name - the name of the counter.
      Returns:
      The operation result
      See Also:
      • SharedData.getLocalCounter(String)
    • getLocalCounterAndForget

      public SharedData getLocalCounterAndForget(String name)
      Get an asynchronous local counter. The counter will be passed to the handler.

      Unlike the bare Vert.x variant, this method ignores the Counter result 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

      public <K, V> LocalMap<K,V> getLocalMap(String name)
      Return a LocalMap with the specific name.
      Parameters:
      name - the name of the map
      Returns:
      the map
    • newInstance

      public static SharedData newInstance(io.vertx.core.shareddata.SharedData delegate)
      Creates a new instance of the SharedData.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object