This PR introduces a new function NewClientWithExistingRedisClient to the Client struct. This function allows the creation of a Client instance using an already established redis.UniversalClient.
Changes:
Added NewClientWithExistingRedisClient function.
New Function Pings the provided Redis client to ensure connectivity.
Creates a new Client instance using the existing Redis client.
Sets the sharedConnection flag to false to indicate that the connection should not be closed by the Client.
This enhancement is useful for scenarios where the Redis connection is managed externally and should not be closed by the Client.
I personally had a project usecase where I didn't want to pass the username password as I wanted to reuse the existing redis client and thus made this addtion.
PR Description
This PR introduces a new function NewClientWithExistingRedisClient to the Client struct. This function allows the creation of a Client instance using an already established redis.UniversalClient.
Changes:
Added NewClientWithExistingRedisClient function.
New Function Pings the provided Redis client to ensure connectivity.
Creates a new Client instance using the existing Redis client.
Sets the sharedConnection flag to false to indicate that the connection should not be closed by the Client.
This enhancement is useful for scenarios where the Redis connection is managed externally and should not be closed by the Client.
I personally had a project usecase where I didn't want to pass the username password as I wanted to reuse the existing redis client and thus made this addtion.