Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:04:41+00:00 2026-05-24T23:04:41+00:00

I am building something like a delay-line: one process RPUSHes objects into a list,

  • 0

I am building something like a delay-line: one process RPUSHes objects into a list, another LPOPs them out in the same order.

The trick is that objects should only be popped from the list one hour after they have been added. I could use a time-stamp for that. The delay is the same for all items and never changes.

Now how to I implement the pop in a concurrency-friendly way (so that it still works when several workers access that list)? I could take out an item, check the timestamp and put it back into the list if it’s still too early. But if several workers do that simultaneously, it may mess up the order of items. I could check the first item and only pop it if it’s due. But another worker might have popped it then so I pop the wrong one.

Should I use the WATCH command? How? Should I use sorted sets instead of a list? Help appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:04:43+00:00Added an answer on May 24, 2026 at 11:04 pm

    Putting the item back in the list after checking it won’t mess up the ordering enough to matter – by having any sort of concurrency you accept that the order won’t be strictly defined. However, that approach won’t be particularly efficient as you can’t check the timestamp without some processing of the item.

    With the scripting build you could implement a conditional pop command for sorted sets, though I don’t think that is the easiest solution.

    There are a couple of ways to implement basic scheduling using multiple lists:

    • Add tasks to a sorted set and have a single worker responsible for moving them from the sorted set to a list that multiple workers access with pop.
    • Have a list for each minute, and have the workers read from past lists. You can minimize the number of lists checked by using another key that tracks the oldest non-empty queue.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building something for mobile and would like somehow to clear, null objects,
I'd like to start messing around programming and building something with an Arduino board,
I'm building something like Facebooks Wall inside of Rails. It will look something like
I really need to create something like the following, I am building 2 classes,
I'm building an application whose usage is going to look something like this: application
Good Evening, I'm building a website which will will look something like this: So
I'm building something that is going to inject HTML into a users website via
I am building a php page something like this .. A jquery syntax decleration
I'm building an application that reads rss files something like Bing or Pulse, so
I'm trying to implement something like Google suggest on a website I am building

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.