feat: Add Redis key prefix support for environment namespacing#1061
feat: Add Redis key prefix support for environment namespacing#1061ryukunt wants to merge 7 commits intohibiken:masterfrom
Conversation
feat: Add Redis key prefix support for environment namespacing
|
@hibiken @kamikazechaser Could you take a look at this or #647? We need this for namespace isolation. |
|
I think its a good must-have feature. I'll see if it can make it for v0.26.0. |
Just wondering — do you have an estimated release date for v0.26.0? And would this feature possibly be included in that version?@kamikazechaser |
| // KeyPrefix is the Redis key prefix for all Asynq operations. | ||
| // This allows you to namespace Asynq keys for different environments. | ||
| // If empty, the default prefix "asynq" will be used. | ||
| // Examples: "asynq-prod", "asynq-dev", "asynq-staging" |
There was a problem hiding this comment.
Please also describe what happens if someone creates multiple clients while setting different prefixes for all of them including a potential empty string.
There was a problem hiding this comment.
Each client instance is designed for a specific use case with its own prefix, so they won't interfere with each other's logic. This actually enhances isolation between different environments or services. If the prefix is an empty string, it defaults to the original "asynq" prefix, maintaining backward compatibility.
|
Overall I think it won't affect most users who ignore this feature. For those who opt into this feature, it should be described in detail on how to correctly use it. |
|
Really need it! |
Hi author, thanks for the awesome project!
I’ve been using it and would like to contribute this feature as well.
This allows different environments or services (prod, staging, dev) to use the same Redis instance without key collisions by namespacing all Asynq keys with a custom prefix.
Thank for your review