I'm using the StackExchange.Redis NuGet package.
I would like to get the Client ID for the connection that is created when I call redis.GetSubscriber(). This method returns an object of type ISubscriber and creates a new connection to the redis server.
I can't find any properties or methods on this object that provides access to the client id of the connection it uses.
I know I can send the CLIENT ID command to redis, but this doesn't help as there doesn't appear to be a way to send this command manually via the ISubscriber object or via any of the objects accessible from it's methods and properties.
I know I can call redis.GetDatabase() and then run db.Execute("CLIENT", "ID"), but GetDatabase() creates a new connection, and the client id that is returned isn't the one being used by the ISubscriber object.
var redis = ConnectionMultiplexer.Connect("localhost:6379");
// This returns an ISubscriber object and creates a new connection
var subscriber = redis.GetSubscriber(); // I want the client id for this connection
// This returns an IDatabase object and also creates a new connection
var db = redis .GetDatabase();
var dbClientId = invalidatorDb.Execute("CLIENT", "ID"); // not the client id I want
Is anyone able to offer some suggestions?