feat: add support for connecting using a IORedis instance#129
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for passing an existing IORedis instance (either Redis or Cluster) to the taskforce-connector instead of connection options. This provides users with more flexibility and control over Redis connection configuration, particularly useful for advanced scenarios requiring custom IORedis settings.
Key Changes:
- Introduced a union type
Connectionthat accepts eitherConnectionOptionsor aRedisConnection(IORedis instance) - Added logic to detect and handle IORedis instances separately from connection options throughout the connection flow
- Updated all Redis client-handling functions to accept an optional
redisClientparameter that takes precedence over connection options
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/socket.ts | Refactored Connection interface to support both options and IORedis instances; added type guard for instance detection; threaded redisClient through function calls |
| lib/queues-cache.ts | Updated updateQueuesCache to accept and propagate optional redisClient parameter |
| lib/queue-factory.ts | Modified core Redis client functions (getRedisClient, ping, getRedisInfo, execRedisCommand, createQueue) to support existing client instances |
| lib/index.ts | Exported new types (ConnectionOptions, RedisConnection) to make them available to library consumers |
| README.md | Added documentation with examples for using existing IORedis instances with both standalone Redis and Redis Cluster |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
roggervalf
approved these changes
Dec 4, 2025
Contributor
|
🎉 This PR is included in version 1.37.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.