Skip to content

feat: add support for connecting using a IORedis instance#129

Merged
manast merged 2 commits intomasterfrom
feat/allow-passing-ioredis-connection-as-option
Dec 4, 2025
Merged

feat: add support for connecting using a IORedis instance#129
manast merged 2 commits intomasterfrom
feat/allow-passing-ioredis-connection-as-option

Conversation

@manast
Copy link
Copy Markdown
Contributor

@manast manast commented Dec 3, 2025

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Connection that accepts either ConnectionOptions or a RedisConnection (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 redisClient parameter 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.

Comment thread lib/index.ts Outdated
Comment thread lib/queue-factory.ts Outdated
Comment thread lib/queue-factory.ts Outdated
@manast manast merged commit bb65491 into master Dec 4, 2025
6 checks passed
@manast manast deleted the feat/allow-passing-ioredis-connection-as-option branch December 4, 2025 20:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 4, 2025

🎉 This PR is included in version 1.37.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants