Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Support custom Redis cache key or prefix #725

Open
shuqingzai opened this issue Aug 21, 2023 · 4 comments
Open

[FEATURE REQUEST] Support custom Redis cache key or prefix #725

shuqingzai opened this issue Aug 21, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@shuqingzai
Copy link

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 shuqingzai added the enhancement New feature or request label Aug 21, 2023
@shuqingzai
Copy link
Author

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

return fmt.Sprintf("asynq:{%s}:", qname)

return fmt.Sprintf("asynq:servers:{%s:%d:%s}", hostname, pid, serverID)

return fmt.Sprintf("asynq:workers:{%s:%d:%s}", hostname, pid, serverID)

return fmt.Sprintf("asynq:schedulers:{%s}", schedulerID)

return fmt.Sprintf("asynq:scheduler_history:%s", entryID)

@hibiken

@kamikazechaser
Copy link
Collaborator

kamikazechaser commented Aug 24, 2023

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.

@hypnoglow
Copy link

See: #647

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

@sunxunkang
Copy link

我的redis有多个asynq服务任务

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

redis cluster mode can not select db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants