Implementation of non-repetitive queues with redis

redis queue lpush rpush inserts the queue without judging the repetition, how to avoid inserting some repetitions?
redis has a collection that does not allow repetition. How can the two of them be implemented together?

Mar.11,2021

as you said, you can try to put your data in SET first. If you don't store it, it means that the data is in SET, so don't execute the push command.
otherwise, consider using lua to do the above, and then provide it to the caller as an instruction.


1. The data entered by set is orderly and non-repetitive, so there is no repetition
2. Delete the data in the collection after each successful execution
3. If the execution fails, store the failed data in another collection and use multiple threads to process Synchronize


list, first lrem and then push

Menu