Skip to content

Commit

Permalink
update broadcast manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Roiocam committed Aug 23, 2024
1 parent 9f791ae commit 5fc0e0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public LettuceBroadcastManager(CacheManager cacheManager, RedisLettuceCacheConfi
this.channel = config.getBroadcastChannel().getBytes(StandardCharsets.UTF_8);
this.lettuceConnectionManager = config.getConnectionManager();
this.lettuceConnectionManager.init(config.getRedisClient(), config.getConnection());
this.lettuceConnectionManager.init(config.getRedisClient(), config.getPubSubConnection());
this.stringAsyncCommands = (BaseRedisAsyncCommands<byte[], byte[]>) lettuceConnectionManager
.asyncCommands(config.getRedisClient());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ private LettuceObjects getLettuceObjectsFromMap(AbstractRedisClient redisClient)
}

public void init(AbstractRedisClient redisClient, StatefulConnection connection) {
map.computeIfAbsent(redisClient, key -> {
LettuceObjects lo = new LettuceObjects();
lo.connection = connection;
return lo;
});
LettuceObjects lettuceObjects = map.computeIfAbsent(redisClient, key -> new LettuceObjects());
lettuceObjects.connection = connection;
}

public void init(AbstractRedisClient redisClient, StatefulRedisPubSubConnection pubSubConnection) {
LettuceObjects lettuceObjects = map.computeIfAbsent(redisClient, key -> new LettuceObjects());
lettuceObjects.pubSubConnection = pubSubConnection;
}

public StatefulConnection connection(AbstractRedisClient redisClient) {
Expand Down

0 comments on commit 5fc0e0a

Please sign in to comment.