asynq icon indicating copy to clipboard operation
asynq copied to clipboard

[FEATURE REQUEST] Support custom Redis cache key or prefix

Open shuqingzai opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

The asynq queue uses asynq as the RedisKey prefix. If my redis has multiple asynq service tasks, all of them will be merged. I hope that custom key or custom key:asynq can be used as a prefix to distinguish different ones Serve

Describe the solution you'd like

I hope that the configuration can customize the redis key prefix

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

shuqingzai avatar Aug 21 '23 10:08 shuqingzai

Is it possible to make asynq in the following func into config options, allowing users to customize, the default is: asynq

https://github.com/hibiken/asynq/blob/6b98c0bbaefbf37907fe4e0404e0408c6ad8a984/internal/base/base.go#L107

https://github.com/hibiken/asynq/blob/6b98c0bbaefbf37907fe4e0404e0408c6ad8a984/internal/base/base.go#L181

https://github.com/hibiken/asynq/blob/6b98c0bbaefbf37907fe4e0404e0408c6ad8a984/internal/base/base.go#L186

https://github.com/hibiken/asynq/blob/6b98c0bbaefbf37907fe4e0404e0408c6ad8a984/internal/base/base.go#L191

https://github.com/hibiken/asynq/blob/6b98c0bbaefbf37907fe4e0404e0408c6ad8a984/internal/base/base.go#L196

@hibiken

shuqingzai avatar Aug 23 '23 15:08 shuqingzai

my redis has multiple asynq service tasks

You could use different redis db id/number (namespace) and create multiple lightweight go-redis connection pools for each of them.

kamikazechaser avatar Aug 24 '23 05:08 kamikazechaser

See: https://github.com/hibiken/asynq/pull/647

We ended up forking because we needed the prefix and Redis Cluster support in the CLI.

hypnoglow avatar Sep 07 '23 19:09 hypnoglow

我的redis有多个asynq服务任务

您可以使用不同的 redis db id/number(命名空间)并为每个数据库创建多个轻量级 go-redis 连接池。

redis cluster mode can not select db

sunxunkang avatar Dec 20 '23 10:12 sunxunkang