0

How can we assign Redis queue to take jobs parallelly? Can we place different queues inside a single Redis queue?

I am making an chat application and I want to completely reduce the delay time. If suppose more people are sending messages at a same timestamp, then there will be more messages at the redis queue. Is there a way to handle that? I am using redis for in-memory data sending.

2 Answers 2

1

Redis is single Threaded. Therefore no items can be handled in parallel. Thats not as bad as it sounds at first as redis can handle these small operations very fast ( see http://redis.io/topics/benchmarks for futher detail on how fast it is)

an ordered list can only handle items with an unique score. So using a ordered list might not be a good idea. But you can use a normal list like this:

  1. store new message LPUSH chatquene message1
  2. store message information

HMSET message1

time 1234 user Adam message hi receiver Eve 3. retrieve most recent message key RPOP chatquene

Sign up to request clarification or add additional context in comments.

Comments

0

Actually you should assign more processor units to the worker that handle the queue. According to the docs of pyton-rq it is a regular pattern and you can accomplish it using supervisor.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.