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

Add redis cluster broker and result-backend #9

Open
steigerung opened this issue Sep 7, 2022 · 7 comments
Open

Add redis cluster broker and result-backend #9

steigerung opened this issue Sep 7, 2022 · 7 comments

Comments

@steigerung
Copy link

steigerung commented Sep 7, 2022

Adding the Redis Cluster broker and result-backend out of the box would be nice advantage, relative to alternative task queues.
But wouldn't it be redundant?

If this idea seems relevant to you, there are some implementation issues.
Using redis-py there is no problem with developing a result-backend, but there are some problems with the broker, more specifically redis.asyncio.RedisCluster client doesn't support pubsub, so it seems the only way to implement AsyncBroker correctly is to initialize redis.asyncio.RedisCluster and subscribe on tasks kicks channel in any master-node through redis.asyncio.Redis, as long as it is alive and switch to another if the current master-node is not working.

@steigerung
Copy link
Author

@chandr-andr up

@chandr-andr
Copy link
Member

chandr-andr commented Sep 12, 2022

@steigerung Hi!
I apologize for the long feedback.
The proposal to use a Redis Cluster is extremely interesting.
I will try to make an MVP that can implement your idea.

@stinovlas
Copy link
Contributor

I'm interested in this. As I see it, implementing support for redis cluster in result backend should be trivial, because it doesn't use PUB/SUB. It only uses SET, EXISTS, GET and GETDEL which are all supported by redis cluster in redis-py.

Even if we only did this, it would still be an improvement, because there are multiple brokers available for taskiq, but only one result backend (at least that's what the official taskiq docs suggests).

I'm willing to implement changes for result backend to support cluster mode. Expect a PR in a few days :-).

@pinguingman
Copy link
Contributor

Hi @s3riusI
Saw that you accepted the pool request, when can I expect a new version of the library? I'm really looking forward to these changes

@s3rius
Copy link
Member

s3rius commented Nov 10, 2023

Hi! I guess we can safely release it now. Because these changes are backward compatible.

@pinguingman
Copy link
Contributor

Are there any plans to create a ListQueueBroker and a PubSubBroker with cluster support?

@s3rius
Copy link
Member

s3rius commented Nov 10, 2023

Sure. I'm not certain about PubSub support. Because in cluster mode it's a bit tricky. But anyway it sounds like a good idea.

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

No branches or pull requests

5 participants