Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Using a Timestamp as a Key for future Notifications

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": []

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.