Search code examples
ruby-on-railsdatabaseeventsdata-structuresqueuing

Triggering a future event based on a current event


i would like to trigger an event sometime in the future based on an event that is currently happening. I do not expect the volume to be too high, so i care a lot more about simplicity than performance.

For example:

  • event A happens. i need event B to happen a day later (not time critical)
  • system stores a record of event in db
  • ongoing process looks through the db, and executes the event Bs that are ready, and removes them from db

Does this make sense? I am using Ruby on rails - I imagine this is a fairly common usecase


Solution

  • Use the DelayedJob gem. Refer to this screen-cast for more details.