From 5185aee75cb1f1ea4f8b55bf2854995ddb931ad0 Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 5 Aug 2015 10:15:35 +0300 Subject: [PATCH] RKeysAsync interface added --- src/main/java/org/redisson/core/RKeys.java | 40 +---------------- .../java/org/redisson/core/RKeysAsync.java | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 39 deletions(-) create mode 100644 src/main/java/org/redisson/core/RKeysAsync.java diff --git a/src/main/java/org/redisson/core/RKeys.java b/src/main/java/org/redisson/core/RKeys.java index 53dd36fdb..04625ea6e 100644 --- a/src/main/java/org/redisson/core/RKeys.java +++ b/src/main/java/org/redisson/core/RKeys.java @@ -2,14 +2,10 @@ package org.redisson.core; import java.util.Collection; -import io.netty.util.concurrent.Future; - -public interface RKeys { +public interface RKeys extends RKeysAsync { String randomKey(); - Future randomKeyAsync(); - /** * Find keys by key search pattern * @@ -23,19 +19,6 @@ public interface RKeys { */ Collection findKeysByPattern(String pattern); - /** - * Find keys by key search pattern in async mode - * - * Supported glob-style patterns: - * h?llo subscribes to hello, hallo and hxllo - * h*llo subscribes to hllo and heeeello - * h[ae]llo subscribes to hello and hallo, but not hillo - * - * @param pattern - * @return - */ - Future> findKeysByPatternAsync(String pattern); - /** * Delete multiple objects by a key pattern * @@ -49,19 +32,6 @@ public interface RKeys { */ long deleteByPattern(String pattern); - /** - * Delete multiple objects by a key pattern in async mode - * - * Supported glob-style patterns: - * h?llo subscribes to hello, hallo and hxllo - * h*llo subscribes to hllo and heeeello - * h[ae]llo subscribes to hello and hallo, but not hillo - * - * @param pattern - * @return - */ - Future deleteByPatternAsync(String pattern); - /** * Delete multiple objects by name * @@ -70,12 +40,4 @@ public interface RKeys { */ long delete(String ... keys); - /** - * Delete multiple objects by name in async mode - * - * @param keys - object names - * @return - */ - Future deleteAsync(String ... keys); - } diff --git a/src/main/java/org/redisson/core/RKeysAsync.java b/src/main/java/org/redisson/core/RKeysAsync.java new file mode 100644 index 000000000..ce328acd1 --- /dev/null +++ b/src/main/java/org/redisson/core/RKeysAsync.java @@ -0,0 +1,45 @@ +package org.redisson.core; + +import java.util.Collection; + +import io.netty.util.concurrent.Future; + +public interface RKeysAsync { + + Future randomKeyAsync(); + + /** + * Find keys by key search pattern in async mode + * + * Supported glob-style patterns: + * h?llo subscribes to hello, hallo and hxllo + * h*llo subscribes to hllo and heeeello + * h[ae]llo subscribes to hello and hallo, but not hillo + * + * @param pattern + * @return + */ + Future> findKeysByPatternAsync(String pattern); + + /** + * Delete multiple objects by a key pattern in async mode + * + * Supported glob-style patterns: + * h?llo subscribes to hello, hallo and hxllo + * h*llo subscribes to hllo and heeeello + * h[ae]llo subscribes to hello and hallo, but not hillo + * + * @param pattern + * @return + */ + Future deleteByPatternAsync(String pattern); + + /** + * Delete multiple objects by name in async mode + * + * @param keys - object names + * @return + */ + Future deleteAsync(String ... keys); + +}