joncrlsn / dque

dque is a fast, embedded, durable queue for Go
MIT License
761 stars 45 forks source link

Move item to end of queue #26

Open jlelse opened 3 years ago

jlelse commented 3 years ago

It would be awesome to have a way to move an item to the end of the queue instead of dequeue and enqueue again. My use case is the following: I use a queue to sequentially send requests and retry failed ones for a couple of times after a certain time threshold. I always peek (block) the first item and after it was processed, dequeue it. When it failed and didn't fail for more than 3 times, I enqueue it again.