RespClient
RespClient copied to clipboard
Want to pass multiple Redis Server to Connect-RedisServer?
Currently Connection is hold as static variables. Thus 1:1 connection is required, means we foreach servers and command.
Some user voice said "want to pass multiple servers, command at once.". This guy image capistrano like usage.
Get-RedisConfig -Key save -Servers 192.168.10.10, 192.168.10.11, 192.168.10.12
or
$connection = Connect-RedisServer -Host 192.168.10.10, 192.168.10.11, 192.168.10.12 -PassThru
Get-RedisConfig -Key save -Connection $connection
How do you think?
It's depend on use case. May be better offering -PassThru
with Connect-RedisServer
and add `-Connection`` to each Cmdlet.
So that you can handle both way of "Persistent Connection" and "OnDemand Connection".
Any idea?
+1 We have migrated to a Redis Cluster, and being able to provide multiple Host is required, otherwise we get a response of "MOVED xx.xx.xx.xx". As a work around we are thinking about building some retry logic that will parse the moved string and connect to the ip it gives.