CacheMemorySource

This commit is contained in:
redkale
2023-09-08 13:12:22 +08:00
parent 4c3f919238
commit 30213e9b0b

View File

@@ -200,7 +200,7 @@ public final class CacheMemorySource extends AbstractCacheSource {
//------------------------ 订阅发布 SUB/PUB ------------------------ //------------------------ 订阅发布 SUB/PUB ------------------------
@Override @Override
public CompletableFuture<List<String>> pubsubChannelsAsync(@Nullable String pattern) { public CompletableFuture<List<String>> pubsubChannelsAsync(@Nullable String pattern) {
Predicate<String> predicate = Pattern.compile(pattern).asPredicate(); Predicate<String> predicate = isEmpty(pattern) ? t -> true : Pattern.compile(pattern).asPredicate();
return CompletableFuture.completedFuture(pubsubListeners.keySet().stream().filter(predicate).collect(Collectors.toList())); return CompletableFuture.completedFuture(pubsubListeners.keySet().stream().filter(predicate).collect(Collectors.toList()));
} }