hibiken / asynq

Simple, reliable, and efficient distributed task queue in Go
MIT License
10.03k stars 716 forks source link

Add NewClientWithExistingRedisClient to create a client with an existing Redis connection #953

Closed sanudatta11 closed 3 weeks ago

sanudatta11 commented 3 weeks ago

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:

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.