Class RedisCacheImpl

  • All Implemented Interfaces:
    Cache, RedisCache

    public class RedisCacheImpl
    extends AbstractCache
    implements RedisCache
    This class is an internal Quarkus cache implementation using Redis. Do not use it explicitly from your Quarkus application.
    • Constructor Detail

      • RedisCacheImpl

        public RedisCacheImpl​(RedisCacheInfo cacheInfo,
                              io.vertx.mutiny.core.Vertx vertx,
                              io.vertx.mutiny.redis.client.Redis redis,
                              Supplier<Boolean> blockingAllowedSupplier)
    • Method Detail

      • get

        public <K,​V> io.smallrye.mutiny.Uni<V> get​(K key,
                                                         Class<V> clazz,
                                                         Function<K,​V> valueLoader)
        Description copied from interface: RedisCache
        Allows retrieving a value from the Redis cache.
        Specified by:
        get in interface RedisCache
        Type Parameters:
        K - the type of key
        V - the type of value
        Parameters:
        key - the key
        clazz - the class of the value
        valueLoader - the value loader called when there is no value stored in the cache
        Returns:
        the Uni emitting the cached value.
      • getAsync

        public <K,​V> io.smallrye.mutiny.Uni<V> getAsync​(K key,
                                                              Class<V> clazz,
                                                              Function<K,​io.smallrye.mutiny.Uni<V>> valueLoader)
        Description copied from interface: RedisCache
        Allows retrieving a value from the Redis cache.
        Specified by:
        getAsync in interface RedisCache
        Type Parameters:
        K - the type of key
        V - the type of value
        Parameters:
        key - the key
        clazz - the class of the value
        valueLoader - the value loader called when there is no value stored in the cache
        Returns:
        the Uni emitting the cached value.
      • put

        public <K,​V> io.smallrye.mutiny.Uni<Void> put​(K key,
                                                            V value)
        Description copied from interface: RedisCache
        Put a value in the cache.
        Specified by:
        put in interface RedisCache
        Type Parameters:
        K - the type of key
        V - the type of value
        Parameters:
        key - the key
        value - the value
        Returns:
        a Uni emitting null when the operation completes
      • put

        public <K,​V> io.smallrye.mutiny.Uni<Void> put​(K key,
                                                            Supplier<V> supplier)
        Specified by:
        put in interface RedisCache
      • getOrDefault

        public <K,​V> io.smallrye.mutiny.Uni<V> getOrDefault​(K key,
                                                                  V defaultValue)
        Specified by:
        getOrDefault in interface RedisCache
      • getOrNull

        public <K,​V> io.smallrye.mutiny.Uni<V> getOrNull​(K key,
                                                               Class<V> clazz)
        Specified by:
        getOrNull in interface RedisCache
      • invalidateAll

        public io.smallrye.mutiny.Uni<Void> invalidateAll()
        Specified by:
        invalidateAll in interface Cache