Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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": []

This comment has been minimized.

Copy link
Owner Author

scalabl3 commented Oct 30, 2013

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
You can’t perform that action at this time.