Class RedisGetSetClient
java.lang.Object
services.moleculer.util.redis.AbstractRedisClient
services.moleculer.util.redis.RedisGetSetClient
Promise-based get/set Redis client.
-
Field Summary
Fields inherited from class AbstractRedisClient
password, resources, secure, urls -
Constructor Summary
ConstructorsConstructorDescriptionRedisGetSetClient(String[] urls, String password, boolean secure, ExecutorService executor, io.lettuce.core.event.EventBus eventBus) -
Method Summary
Modifier and TypeMethodDescriptionfinal io.datatree.Promiseclean(String match, AtomicLong counter) Deletes a group of items.final voidconnect()final io.datatree.PromiseDeletes a content with the specified key.final io.datatree.Promisefinal io.datatree.PromiseGets a content by a key.io.datatree.PromisegetCacheKeys(io.datatree.Tree keys) final io.datatree.PromiseSets a content by key.Methods inherited from class AbstractRedisClient
parseURLs
-
Constructor Details
-
RedisGetSetClient
public RedisGetSetClient(String[] urls, String password, boolean secure, ExecutorService executor, io.lettuce.core.event.EventBus eventBus)
-
-
Method Details
-
connect
public final void connect()- Overrides:
connectin classAbstractRedisClient
-
get
Gets a content by a key.- Parameters:
key- cache key- Returns:
- Promise with cached value (or null, the returned Promise also can be null)
-
set
Sets a content by key.- Parameters:
key- cache keyvalue- new valueargs- Redis arguments (eg. TTL)- Returns:
- Promise with empty value
-
del
Deletes a content with the specified key.- Parameters:
key- cache key- Returns:
- Promise with empty value
-
clean
Deletes a group of items. Removes every key by a match string.- Parameters:
match- regexcounter- counter of deleted records- Returns:
- Promise with empty value
-
getCacheKeys
public io.datatree.Promise getCacheKeys(io.datatree.Tree keys) -
disconnect
public final io.datatree.Promise disconnect()- Overrides:
disconnectin classAbstractRedisClient
-