Bj Blazkowicz
Bj Blazkowicz

Reputation: 1177

Round robin pub/sub with StackExchange.Redis

I know that redis does not natively support round-robin distribution of messages to clients. But I'm wondering if there is something I can do to achieve this with StackExchange.Redis?

In other words: I wan't published messages to a channel to be evenly distributed among subscribing clients.

I guess I could just poll a blocking list pop? Or is it better to subscribe to a channel(for blocking) and then right pop work from a list?

Thanks, Bj

Upvotes: 1

Views: 1207

Answers (1)

Marc Gravell
Marc Gravell

Reputation: 1063501

SE.Redis does not support blocking pops. If you need genuine round-robin, I would suggest doing that at the client by rotating the channel-name/key-name between the known clients. If you just need people to get work when they are ready, a polling pop with pub/sub for immediacy works well.

Upvotes: 2

Related Questions