Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Using a Timestamp as a Key for future Notifications

View gist:7235173

Notification Document

KEY: 10/31/2013::20:00

{
    "email": [
        { "uid": 1029, "content_id": "c::2822020", "type": "halloween" }
        { "uid": 2058, "content_id": "c::2822020", "type": "halloween" }
    ],
    "push": [
       { "phone": "404-555-1212", "content_id": "c::2822021" } 
    ]
}

and another one the following minute:

KEY: 10/31/2013::20:01

{
    "email": [
      { "uid": 2203, "content_id": "c::2822020", "type": "halloween" }
      { "uid": 8928, "content_id": "c::2822020", "type": "halloween" }
    ],
    "push": []
}
Owner

You create a worker that once a minute grabs the notifications document and puts the tasks within the document into worker queues for each type of task (of course you can just have one type or many types). Then you have a bank of workers that watch the queue(s) and perform the tasks (they are ignorant workers that don't need to know bout how the tasks get into the queue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.