#time based message queues

1 messages · Page 1 of 1 (latest)

upper dust
#

Hi all, I have an interesting requirement. I want to setup a queue that waits for either multiple responses or until a set time after the initial request was received so I can push out notifications.

For example I have a job with multiple activities to complete. The first activity gets updated and now we should wait Xminutes to wait for more activities to be completed before sending the notification. If the job completes all activities before Xminutes ignore the timer and send it out.

Has anyone implemented something like this? I'm using AWS and was looking at sns sqs.

nimble jay
#

How do you know when all activities are completed?

upper dust
#

It's a set list of activities, for example I'd have a boolean on each which would determine if they're complete.

{
  jobId: 1,
  activities: [{
    name: 'thing to do',
    complete: false,
  },
  {
    name: 'second thing',
    complete: true,
  }]
}```
#

Hmm, I might setup a queue database and actually store the data. When the first activity gets completed I'll get the ORM to add the job ID into a mail list and check that periodically against a timestamp for my conditions to be met.