Add RedisClusterClient
This commit is contained in:
parent
f8470fc8f6
commit
86abebf9bf
2 changed files with 26 additions and 4 deletions
17
src/io/cluster/redisclusterclient.js
Normal file
17
src/io/cluster/redisclusterclient.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class RedisClusterClient {
|
||||
constructor(frontendPool) {
|
||||
this.frontendPool = frontendPool;
|
||||
}
|
||||
|
||||
getSocketConfig(channel) {
|
||||
return this.frontendPool.getFrontends(channel).then(result => {
|
||||
if (!Array.isArray(result)) {
|
||||
result = [];
|
||||
}
|
||||
|
||||
return { servers: result };
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { RedisClusterClient };
|
||||
Loading…
Add table
Add a link
Reference in a new issue