On Wed, May 22, 2013 at 7:17 AM, Keith Rarick <[email protected]> wrote: > On Tue, May 21, 2013 at 12:37 AM, Jesús Gabriel y Galán > <[email protected]> wrote: >> So I made a proof >> of concept in which when a user subscribed I insert a job in >> beanstalkd with a week delay. Then n workers will listen for jobs, get >> one, make a try and if it fails return it to the queue with a >> calculated delay (5 minutes or 1 day, for example). > > It's hard to say whether this is good without knowing some > more details about what you're doing. But if you've already > tried it and it works well, then I'd say it's a good approach.
Thanks for your answer. What I am doing is managing many paid subscription services. Users subscribe to the service, and every week I have to bill them. If the billing fails, I have a retry policy within the week, that depends on each service. I don't mind to-the-second accuracy, but I wouldn't like to skip any billing try for several hours, so it's fine. >> should I use an external database and run checks against this >> external data > > That will probably be more reliable in the long run. Beanstalkd > isn't a database. You might consider a periodic cron job that > scans the database looking at timestamps, and generates > beanstalkd jobs to do whatever work is necessary. But again, > evaluating these approaches is hard to do in the abstract. In my proof of concept, I never delete the jobs, I only release with delay. This means that even if the client fails, the job is always in the queue, correct? Anyway, what I wanted to understand was if there was a way to inspect the jobs that are in the queue, to check that every user has at least one job in the queue. If there isn't, the only way is to check that a job has executed for the user in the last week, or to insert jobs for all users every once in a while, but this might be overkill. Thanks, Jesus. -- You received this message because you are subscribed to the Google Groups "beanstalk-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/beanstalk-talk?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
