Facebook
From Masoud, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 60
  1. In the current system, we have a Scheduling Service that takes incoming HTTP API requests. It adds entries to a ScheduledTweetsDatabase.
  2.  
  3. The ScheduledTweetsDatabase is some kind of relational database with fields for eventID (string), userID (string), content (string), scheduledFor (timestamp),
  4.  
  5.  
  6. and sent (boolean). It is indexed on eventID and scheduledFor.
  7.  
  8. field    | eventID | userID | content | scheduledFor |  sent
  9.          +---------+--------+---------+--------------+---------
  10. type     | string  | string | string  |  timestamp   | boolean
  11. indexed? | indexed |        |         |   indexed    |
  12.  
  13.  
  14. An ExecutorService polls the ScheduledTweetsDatabase for events with a scheduledFor in the past and sent=False. It then publishes the content by sending a POST request to the public Tweet API and updates the event with sent=True in the ScheduledTweetsDatabase.
  15.